Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.03 KB

README.md

File metadata and controls

29 lines (23 loc) · 1.03 KB

CHROOT-SFTP

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.

SFTP Configuration:

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