Last active
August 25, 2019 11:41
-
-
Save jcwright77/7d5a934338140af025eba6f6e0868c32 to your computer and use it in GitHub Desktop.
ssh_key_create
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 key | |
ssh-keygen -f <keyname> -C this is a test | |
#verify passphrase | |
ssh-keygen -y -f <keyname> | |
#install key locally | |
# optionally create .ssh | |
mkdir ~/.ssh | |
chmod 700 ~/.ssh | |
cp -p <keyname> <keyname.pub> ~/.ssh/ | |
#install key remotely | |
ssh-copy-id -i <keyname> <user>@<server> | |
#ssh-copy-id may not be on OSX by default, it can be installed with macports or brew, it is mostly equivalent to | |
cat ~/.ssh/<serverkey>.pub | ssh user@hostname 'cat >> .ssh/authorized_keys' | |
#login with new key | |
ssh -i <keyname.pub> <user>@<server> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment