Skip to content

Instantly share code, notes, and snippets.

@moeiscool
Created October 3, 2020 03:48
Show Gist options
  • Save moeiscool/c0ace30e0a25676289bc507205a917a8 to your computer and use it in GitHub Desktop.
Save moeiscool/c0ace30e0a25676289bc507205a917a8 to your computer and use it in GitHub Desktop.
Quickly Enable Passwordless Login for SSH with an RSA Key (Must already have Key generated)
PUBLICKEY="YOUR_PUBLIC_KEY_HERE"
echo "ssh-rsa $PUBLICKEY" >> ~/.ssh/authorized_keys
cat ~/.ssh/authorized_keys
sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
sed -i 's/ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
service sshd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment