Skip to content

Instantly share code, notes, and snippets.

@mauris
Created April 30, 2013 13:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauris/5488614 to your computer and use it in GitHub Desktop.
Save mauris/5488614 to your computer and use it in GitHub Desktop.
Prepare your SSH daemon for key exchange authentication!
# bootstrap
mkdir ~/.ssh
cd ~/.ssh
# create authorized_keys file
touch authorized_keys
# at this step, add authorized keys into the touch
# prepare file permissions
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
#disable password authentication
sudo sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/g" "/etc/ssh/sshd_config"
sudo sed -i "s/PasswordAuthentication yes/PasswordAuthentication no/g" "/etc/ssh/sshd_config"
#restart SSH server
sudo /etc/init.d/ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment