Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@efarem 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
You can’t perform that action at this time.