SSH keys & OSX

Put your private & public key on folder ~/.ssh
All private keys must have 600 rights (-rw——-), or they will be ignored.

  1. List your currently load keys:
    ssh-add -l
    
  2. Load your keys on ssh-agent and store them on OSX Keychain for future use
    ssh-add -K /path/of/private/key
    

    Eventually type the SSH key’s secret if prompted.

All your SSH keys should have been added to your “session” keychain for the application SSH.
From now on, when you need to connect with SSH, you can load all of your private keys at once with the following command

    ssh-add -A

To go further

Get speedy with a config file

You can setup a config file for your frequently accessed servers, and preconfigure all the connection details:

  • user,
  • ssh port,
  • etc …

Reuse existing putty keys (*.ppk)

Make a good use of puttygen … (To be described one day, maybe …)

References

I used the following informations found on the web and obviously the manual to get the whole thing working.
Thanks you to each of the authors for their valuable informations.

Adding a Private Key to Your Mac OSX Keychain
Simplify Your Life With an SSH Config File
Using an SSH Config File

Leave a Reply

Your email address will not be published. Required fields are marked *