We will setup our ssh key to connect to Github.
Typically you would have one key pair for your machine but sometimes you need multiple
ie: personal, work internal and client.
This files lets us setup diffent host to use our ssh key.
nano ~/.ssh/config
#~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
# git clone [email protected]:[account]/[project].git
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yesssh-add ~/.ssh/id_rsa#List fingerprints of all identities.
ssh-add -l
#List public key parameters of all identities.
ssh-add -L
Add the Public key to the server you want to connect to. ie: github.com
#Copy Public key to clipboard.
pbcopy < ~/.ssh/id_rsa.pubssh -T github.com
For when you need to remove your identities.
#Delete all identities.
ssh-add -DExample Host for different situations.
#EXAMPLES
# ssh cwc-server
Host cwc-server
HostName ssh.example.com
Port 1111
User cwc
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
# ssh cwc-client
Host cwc-client
HostName client.example.com
User cwc
IdentityFile ~/.ssh/id_rsa_client
IdentitiesOnly yes
# git clone git@gh-work:[account]/[project].git
Host gh-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work
IdentitiesOnly yes