Created
January 21, 2014 22:29
-
-
Save DiegoSalazar/8549794 to your computer and use it in GitHub Desktop.
Add an SFTP user, assuming an sftpusers group and the user's home folder already exists.
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
add_sftp_user() { | |
sudo useradd -d /home/$1 $1 | |
sudo passwd $1 | |
sudo usermod -g sftpusers $1 | |
sudo usermod -s /bin/false $1 | |
sudo chown $1:sftpusers -R /home/$1 | |
sudo chown root:root /home/$1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment