Last active
March 24, 2025 04:08
-
-
Save MParvin/82322aa191be79067dec49a553a0a350 to your computer and use it in GitHub Desktop.
Add my ssh keys to authorized_keys in home directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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