[ Dana = Local Machine ]
[ Michael = remote machine ]
- cd into home .ssh directory on Dana
cd ~/.ssh
- On Dana Create a keypair and include a passphrase (we can have apple keychain save it and never have to remember it... thanks ssh-agent)
ssh-keygen -t rsa -C "key for blablabla"
By default it will create "id_rsa" and "id_rsa.pub"
- Append *.pub created to ~/.ssh/authorized_keys on Michael
ssh user@michael
scp id_rsa.pub ~/.ssh/authorized_keys
- On Dana modify the config file
vi ~/.ssh/config
Host dana
Hostname dana.box.com
User username
IdentityFile ~/.ssh/id_rsa
- Now SSH in and it should ask you to save your passphrase to your keychain. You can now use the Host specified in the config file
ssh dana
- You're done, now you are using the key with your passphrase everytime but never need to remember it. Your computer will save it securely for you.
:-)
😄
🌴