Last active
April 7, 2021 18:16
-
-
Save mpalpha/aa2bdfc8b96d28f192c3 to your computer and use it in GitHub Desktop.
ssh key generator for osx (passphrase is your current user name)
This file contains 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
# make executable with 'chmod a+x sshmac.sh' if needed | |
if [ "$(uname)" == "Darwin" ]; then | |
# Generate ssh key for Mac OS X platform | |
cd ~/ | |
mkdir .ssh | |
cd .ssh | |
ssh-keygen -t rsa -N "$(id -u -n)" -f id_rsa | |
ssh-add ~/.ssh/id_rsa | |
sleep 0.05m | |
pbcopy < ~/.ssh/id_rsa.pub | |
echo "ssh key was copied to your clipboard" | |
else | |
echo "ssh key generation failed: this is not a mac" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment