Skip to content

Instantly share code, notes, and snippets.

@brpaz
Forked from JoshuaEstes/user.sh
Last active August 29, 2015 14:08
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 brpaz/10243211f3f7cd06cc11 to your computer and use it in GitHub Desktop.
Save brpaz/10243211f3f7cd06cc11 to your computer and use it in GitHub Desktop.
creates a deploy user #linux #deploy
# Remote Server
useradd www-deploy -c "Deployment User" -d /home/www-deploy -G www-data -m -s /bin/bash
sudo su - www-deploy
# Localhost
ssh-keygen -t rsa
# Append your key to the Remote host authorized keys file
cat id_rsa.pub >> ~/.ssh/authorized_keys
# Remote Host
#vim /etc/ssh/sshd_config
sed -i '/^#*RSAAuthentication /c RSAAuthentication yes' /etc/ssh/sshd_config
sed -i '/^#*PubkeyAuthentication /c PubkeyAuthentication yes' /etc/ssh/sshd_config
sed -i '/^#*ChallengeResponseAuthentication /c ChallengeResponseAuthentication no' /etc/ssh/sshd_config
sed -i '/^#*PasswordAuthentication /c PasswordAuthentication no' /etc/ssh/sshd_config
sed -i '/^#*UsePAM /c UsePAM no' /etc/ssh/sshd_config
service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment