Skip to content

Instantly share code, notes, and snippets.

@MParvin
Last active March 24, 2025 04:08
Show Gist options
  • Save MParvin/82322aa191be79067dec49a553a0a350 to your computer and use it in GitHub Desktop.
Save MParvin/82322aa191be79067dec49a553a0a350 to your computer and use it in GitHub Desktop.
Add my ssh keys to authorized_keys in home directory
#!/bin/bash -exu
my_user=$(whoami)
my_group=$(groups | awk '{print $1}')
mkdir -p ~/.ssh
chown $my_user:$my_group ~/.ssh
chmod 700 ~/.ssh
curl -SsL github.com/mparvin.keys > ~/.ssh/authorized_keys
chown $my_user:$my_group ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment