SFTP (SSH) chroot

Soldato
Joined
14 Oct 2003
Posts
7,831
All,

Do you know how to chroot users to home-dirs using sftp?

Like user bob is forced into /home/bob and can't get anywhere else on the box and user jim is forced into /home/jim

I know you can force all users to one chroot, but what about separate ones?

Cheers.
 
Yeah, this is a unix box. Normally with FTP you can force people to only see their home directories when they FTP and they can't browse the rest of the file system.
 
Ahh, apparently you can do:

Match user anonsftp
ForceCommand internal-sftp -R
ChrootDirectory /chroot/home
PermitEmptyPasswords yes
PasswordAuthentication yes
AllowAgentForwaring no
AllowTcpForwarding no
X11Forwarding no

In /etc/sshd/sshd_config
 
Back
Top Bottom