Created
February 9, 2018 09:48
-
-
Save eidosam/246696e16a540819e3d20c50b6d3af64 to your computer and use it in GitHub Desktop.
Add SFTP user can access only SFTP service
This file contains 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
adduser sftping | |
mkdir -p /var/sftp/ | |
chmod 755 /var/sftp | |
chown sftping: /var/sftp/ | |
cat <<'EOF' >> /etc/ssh/sshd_config | |
Subsystem sftp internal-sftp | |
Match User sftping | |
X11Forwarding no | |
AllowTcpForwarding no | |
AllowAgentForwarding no | |
ForceCommand internal-sftp | |
PasswordAuthentication yes | |
ChrootDirectory /var/sftp | |
PermitTunnel no | |
EOF | |
service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment