Created
March 5, 2015 17:21
-
-
Save efarem/8e9f198819f92952c1ea to your computer and use it in GitHub Desktop.
New SFTP User
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
useradd [username] | |
passwd [username] | |
usermod -g www-data -G [username] -d [home-directory] -s /usr/sbin/nologin [username] | |
Add this to bottom of /etc/ssh/sshd_config | |
Match User [username] | |
ChrootDirectory [home-directory] | |
PasswordAuthentication yes | |
X11Forwarding no | |
AllowTcpForwarding no | |
ForceCommand internal-sftp | |
sudo service ssh restart | |
chown [username]:www-data [home-directory]/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure root is the owner of home-directory and has no group/others write permissions