Creating multiple chroots

Edit the /etc/ssh/sshd_config:

1. Comment out the Subsystem sftp line
2. Create line as follows:
Subsystem sftp internal-sftp
3. Add the following at the bottom of the sshd_config file:
Match Group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTCPForwarding no
ForceCommand internal-sftp
4. Restart ssh
5. Create a file called create_chroot.sh:
useradd -d /home/contractor3 -s /bin/false -G sftponly contractor3
chown root:root /home/contractor3/
chmod 755 /home/contractor3/
mkdir /home/contractor3/upload
chown contractor3:contractor3 /home/contractor3/upload
passwd contractor3

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.