Last active
October 10, 2015 07:57
-
-
Save JoshuaEstes/3658524 to your computer and use it in GitHub Desktop.
Script to create a deployment user on a linux box
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
# 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