Results 1 to 4 of 4

Thread: SSH access to only users home folder

  1. #1
    Join Date
    Jul 2007
    Location
    USA
    Beans
    186
    Distro
    Ubuntu

    Want users to only have ssh access to their home dir

    I would like to set a user to only be able to be in their home directory. I have a user that sftp in to my ubuntu 8.04 server. I only want him to be able to see his home directory I dont even want this user to be able to navigate away from his /home/"USERNAME"/

    I also use ssh and do not want to be restricted.

    Is this possible?
    Last edited by bshosey; September 10th, 2008 at 06:53 PM.

  2. #2
    Join Date
    Oct 2006
    Location
    Belgrade, Serbia
    Beans
    1,321
    Distro
    Ubuntu

    Re: SSH access to only users home folder

    You need sftp or ssh restriction? Your title doesn't match your post
    I think you can restrict them using the chroot command

  3. #3
    Join Date
    Oct 2006
    Location
    Belgrade, Serbia
    Beans
    1,321
    Distro
    Ubuntu

    Re: SSH access to only users home folder

    1) rssh + chroot: http://www.cyberciti.biz/tips/rhel-c...ssh-shell.html
    2) modify your permissions, so that "others" can't see the files/folders.
    Usually it's good to restrict the home folder, so that others can't see the other usernames.. as far as system files, I'm not sure.
    3) I'm not sure, but you could read about bash -r / restrictive shell
    http://www.gnu.org/software/bash/man...stricted-Shell
    4) Finally, you have chroot jail utilities
    in ssh config: http://undeadly.org/cgi?action=artic...20080220110039
    package names:
    jailer - Builds and maintains chrooted environments
    jailtool - Tool to build chroot-jails for daemons
    libapache2-mod-chroot - run Apache in a secure chroot environment
    makejail - Automatically create chroot jails for programs
    mod-chroot-common - run Apache in a secure chroot environment
    rssh - Restricted shell allowing only scp, sftp, cvs, rsync and/or rdist
    uml-utilities - User-mode Linux (utility programs)
    user-mode-linux - User-mode Linux (kernel)
    util-vserver - user-space tools for Linux-VServer virtual private servers
    Last edited by forger; September 10th, 2008 at 06:19 PM.

  4. #4
    Join Date
    Dec 2007
    Beans
    1,045

    Re: SSH access to only users home folder

    Quote Originally Posted by forger View Post
    1) rssh + chroot: http://www.cyberciti.biz/tips/rhel-c...ssh-shell.html
    2) modify your permissions, so that "others" can't see the files/folders.
    Usually it's good to restrict the home folder, so that others can't see the other usernames.. as far as system files, I'm not sure.
    3) I'm not sure, but you could read about bash -r / restrictive shell
    http://www.gnu.org/software/bash/man...stricted-Shell
    4) Finally, you have chroot jail utilities
    in ssh config: http://undeadly.org/cgi?action=artic...20080220110039
    package names:
    and how do you change the /etc/passwd file?

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
  •