Created
October 3, 2020 03:48
-
-
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)
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
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