Skip to content

Instantly share code, notes, and snippets.

@efarem
Created March 5, 2015 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efarem/8e9f198819f92952c1ea to your computer and use it in GitHub Desktop.
Save efarem/8e9f198819f92952c1ea to your computer and use it in GitHub Desktop.
New SFTP User
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]/*
@efarem
Copy link
Author

efarem commented Mar 5, 2015

Make sure root is the owner of home-directory and has no group/others write permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment