Skip to content

Instantly share code, notes, and snippets.

@mustafaturan
Created May 17, 2019 03:24
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 mustafaturan/0d95dc17d84222457148575bedfb60ea to your computer and use it in GitHub Desktop.
Save mustafaturan/0d95dc17d84222457148575bedfb60ea to your computer and use it in GitHub Desktop.
Login via private ssh key on Raspberry Pi
cd
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
sh -c 'echo "ssh-rsa ... sample@example.com" >> ~/.ssh/authorized_keys'
chmod 600 ~/.ssh/authorized_keys
sudo vim /etc/ssh/sshd_config

There are three lines that need to be changed to no, if they are not set that way already:

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Refs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment