Results 1 to 5 of 5

Thread: chroot user in ssh config file

  1. #1
    Join Date
    May 2009
    Location
    Wales UK
    Beans
    333
    Distro
    Ubuntu 12.04 Precise Pangolin

    chroot user in ssh config file

    I was reading in: SSH The Secure Shell,The Definitive Guide. that in the /etc/ssh/sshd_config file a user could be chrooted to their home folder by the command

    chroot <username>

    but it said it could only be used in SSH2. since the publication of said book (2001) and knowing that openSSH incorporated some SSH2 methodology, is this command usable in the current openSSH?

    or is their another method used to achive this?

    Many Thanks

  2. #2
    Join Date
    May 2009
    Location
    Wales UK
    Beans
    333
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: chroot user in ssh config file

    i Tryed placing this command in the /etc/ssh/sshd_config file and restarted the demon, from that it refused to let any ssh logins at all!

    So i guess the short answer is NO!

  3. #3
    Join Date
    Nov 2005
    Beans
    35
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: chroot user in ssh config file

    You should be able to apply the chroot to just one user if you combine it with the 'Match' argument.

    Code:
    man sshd_config
    for details

  4. #4
    Join Date
    Sep 2011
    Beans
    92

    Re: chroot user in ssh config file

    more precisely you can match also a group.

    That's what I've done:

    1 create user (testuser) and group (eg remote)
    2 setup jail (copy files and directories)
    3 used "l2chroot" script for copying libraries
    4 configured sshd_config as followed

    Code:
    match group remote
      ChrootDirectory /jail/home/testuser
    And now I'm stuck at the following message while connecting -.-

    Code:
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    Write failed: Broken pipe
    Any suggestions ?

  5. #5
    Join Date
    Sep 2011
    Beans
    92

    Re: chroot user in ssh config file

    ah sorry to meddle with them solved questions <.<

    cheers,

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
  •