Last active
October 29, 2019 19:49
-
-
Save mamedshahmaliyev/76b09a33b5b04385b776e9bbee79922b to your computer and use it in GitHub Desktop.
How to create chroot user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useradd sftp_user | |
passwd sftp_user | |
################################################################################################################# | |
# VERY IMPORTANT: all the elements in /path/to/chroot_folder must be owned by root with at most 755 permissions # | |
################################################################################################################# | |
echo ''' | |
Match User sftp_user | |
X11Forwarding no | |
AllowTcpForwarding no | |
ChrootDirectory /path/to/chroot_folder | |
ForceCommand internal-sftp -u 002 # mask for 775 | |
''' >> /etc/ssh/sshd_config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment