Skip to content

Instantly share code, notes, and snippets.

@MalteHei
Last active March 2, 2023 11:04
Show Gist options
  • Save MalteHei/93813737754b1291066199ed0f9f9a33 to your computer and use it in GitHub Desktop.
Save MalteHei/93813737754b1291066199ed0f9f9a33 to your computer and use it in GitHub Desktop.
Add Your Public SSH Key to a Machine for Passwordless Logins
SSH_DIR=~/.ssh
AUTH_KEYS_FILE=$SSH_DIR/authorized_keys
mkdir -p $SSH_DIR
chmod 700 $SSH_DIR
touch $AUTH_KEYS_FILE
chmod 600 $AUTH_KEYS_FILE
echo -n 'INSERT_YOUR_PUBLIC_KEY_HERE' >> $AUTH_KEYS_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment