Results 1 to 10 of 12

Thread: HOWTO: Install and setup chrooted SFTP users with openssh-5.0p1 from scratch

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Beans
    23

    Re: HOWTO: Install and setup chrooted SFTP users with openssh-5.0p1 from scratch

    Quote Originally Posted by lusixhan View Post
    -----------------------------------------

    (3) Giving SFTP users read access to some other directory

    As an interesting aside, let's say you (the sysadmin) have a common info/media/data directory you wish to share with your sftp users without actually copying all that data over (or allowing it to be edited/deleted/corrupted). We can do this by mounting it read-only somewhere in their login directory. They're going to need a place to get to it:

    Code:
    $ sudo mkdir /home/johndoe/readonly
    Now we mount our directory of choice (in this example, /home/sysadmin/junk/shared-data) as read-only in said folder:

    Code:
    $ sudo mount -r --bind /home/sysadmin/junk/shared-data /home/johndoe/readonly
    It might help to add the above command to /etc/rc.local so that it happens automatically on startup. Anything added to rc.local will run as root at startup, so there is no need to indicate 'sudo'. In other words, you would add this command to /etc/rc.local as follows (before the 'exit 0' of course):

    Code:
    mount -r --bind /home/sysadmin/junk/shared-data /home/johndoe/readonly
    Note: You cannot mount more than one folder/device/partition/netshare in a particular location. Doing so won't damage anything, but the mount point will only display the object mounted last in sequence.

    -----------------------------------------
    I used to have this set up just fine, having the appropriate entries in my /etc/fstab file like the example below:
    Code:
    UUID=XXXX /media/dir1 ext3 defaults 0 0
    /media/dir1 /home/guest/dir1 none ro,bind 0 0
    Since upgrading to 10.04 Beta 2, this no longer works and attempted mounting spits out that the directory is still mounted read-write. Any suggestions?

  2. #2

    Jailed SFTP with repositories' packages

    I've seen your guide for chrooted SFTP, and I've learnt from a lot of tutorials as yours. Here my compendium to configure better clients and servers:

    http://wiki.lapipaplena.org/index.ph..._SFTP_accesses

    (special care of users and permissions)
    Narcis Garcia

  3. #3

    Re: HOWTO: Install and setup chrooted SFTP users with openssh-5.0p1 from scratch

    A domain name has changed for Lapipaplena. Please update the link for:
    http://wiki.gilug.org/index.php/How_..._SFTP_accesses
    Narcis Garcia

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •