Shell scripts for managing (i.e. create/delete) SFTP users in CHROOT JAIL Environment.
Script successfully tested on Fedora 23, RedHat Enterprise Linux 6.x.
Dependencies: OpenSSH
Configuration:
- Edit /etc/ssh/sshd_config
# sudo vim /etc/ssh/sshd_config
- Comment existing Subsystem:
# Subsystem sftp /usr/lib/openssh/sftp-server
- Add at end of sshd_config file, add the following lines:
Subsystem sftp internal-sftp
Match Group sftpusers
ChrootDirectory /opt/sftp/%u
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no
- Create SFTP CHROOT Directory and add SFTP Group :
# mkdir /opt/sftp/
# groupadd sftpusers