Skip to content

Instantly share code, notes, and snippets.

@c3ph3us
Forked from RichardBronosky/get_authorized_keys.sh
Created August 17, 2023 15:49
Show Gist options
  • Save c3ph3us/457e80def46acce38c476d00ce78a4ca to your computer and use it in GitHub Desktop.
Save c3ph3us/457e80def46acce38c476d00ce78a4ca to your computer and use it in GitHub Desktop.
Get ssh keys for Raspberry Pi from GitHub
sudo bash <<EOF
local_user=pi
github_user=RichardBronosky
umask 077
mkdir -p ~$local_user/.ssh
curl -sSL https://github.com/${github_user}.keys >> ~$local_user/.ssh/authorized_keys
chown -R $(id -u $local_user):$(id -g $local_user) ~$local_user/.ssh
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment