Jailed SFTP Users With CentOS

Offering SFTP-only jailed user accounts is useful in many scenarios such as shared web hosts, storage space for friends, etc.

This tutorial is specific to CentOS 5.4 x86 64-bit. Other flavors will vary.

** Make sure you are root or using Sudo

1. Upgrade to OpenSSH 5.x

 

2. Comment out the following line in ‘/etc/ssh/sshd_config’

3. Append these lines to the end of ‘/etc/ssh/sshd_config’

4. Add the ‘sftponly’ user group

5. Modify the user’s group and shell

(I’ll use the completely random username: bree_olson)

6. Set the proper filesystem permissions

(Bree’s home directory is /home/bree_olson and her website is in /home/bree_olson/public_html)

7. Restart the SSHD daemon