Using SSH config files
August 07, 2020
Are you tired of passing in your private key and user on every ssh connection?
ssh -i ~/.ssh/example_private_key.rsa user@hostname.com
Then just create a user ssh configuration file ~/.ssh/config
. For example.
Host githubHostName github.comUser gitIdentityFile ~/.ssh/example_private_key.rsa
Now you can just type.
ssh github
Which will internally translate to ssh -i ~/.ssh/example_private_key.rsa git@github.com