Skip to content

Instantly share code, notes, and snippets.

@azye
Last active June 8, 2022 06:44
Show Gist options
  • Save azye/00ef91c2db35744da25359708a4aea5a to your computer and use it in GitHub Desktop.
Save azye/00ef91c2db35744da25359708a4aea5a to your computer and use it in GitHub Desktop.
Add an authorized key to your linux user
SSH_KEY=<ssh_key>
mkdir -p $HOME/.ssh
touch $HOME/.ssh/authorized_keys
echo $SSH_KEY > $HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown -R $(whoami):$(whoami) $HOME/.ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment