Skip to content

Instantly share code, notes, and snippets.

@clintcolding
Created July 9, 2019 17:25
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintcolding/ad759555d5f3f1e5d076bc180ca3a85e to your computer and use it in GitHub Desktop.
Save clintcolding/ad759555d5f3f1e5d076bc180ca3a85e to your computer and use it in GitHub Desktop.
Configure Raspberry Pi SSH Keys
#---- Create key on client ----#
ssh-keygen -b 2048 -t rsa
#---- Validate creation ----#
ls ~/.ssh
#---- SSH to Pi and create the SSH directory and file ----#
mkdir .ssh
cd .ssh
touch authorized_keys
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
#---- From your client, copy your key to Pi ----#
cat ~/.ssh/id_rsa.pub | ssh pi@192.168.1.2 'cat >>.ssh/authorized_keys'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment