Thursday, July 1, 2010

In /etc/ssh/sshd_config :
Comment out Subsystem sftp /usr/lib/openssh/sftp-server and replace it with:

Subsystem sftp internal-sftp

At the end of the sshd_config add the following:

Match group sftponly
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Type the following commands as root, i.e. sudo in front of each command or sudo -s before you start.

1. chown root.root /home/
2. usermod -d /
3. adduser sftponly

No comments: