Created
April 13, 2015 16:34
-
-
Save bensojona/74ed44e5518c7f371d9e to your computer and use it in GitHub Desktop.
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
if [ -s "ssh_keys/$1-key.pem" ] && [ -s "ssh_keys/$1-key.pub" ]; then | |
echo Using existing $1-key pair... | |
else | |
echo No $1-key pair exists, generating new keys... | |
rm -rf ssh_keys/$1-key.pem | |
rm -rf ssh_keys/$1-key.pub | |
openssl genrsa -out ssh_keys/$1-key.pem 1024 | |
chmod 400 ssh_keys/$1-key.pem | |
ssh-keygen -y -f ssh_keys/$1-key.pem > ssh_keys/$1-key.pub | |
echo ssh_keys/$1-key.pem contents... | |
cat ssh_keys/$1-key.pem | |
echo ssh_keys/$1-key.pub contents... | |
cat ssh_keys/$1-key.pub | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment