/
Generate an SSH Key Pair from Mac

Generate an SSH Key Pair from Mac

Generate an SSH Key Pair

  1. Open a new Terminal window

  2. Type ssh-keygen -b 4096 -t rsa 

  3. You will be prompted to enter a filename. By default, your keys will be saved as id_rsa and id_rsa.pub. Simply press Enter to confirm the default - there is no need to change this unless you have multiple keys! (Note: if you would like to change the default filename, you'll need to include the complete file path)

  4. When prompted, enter a passphrase.

  5. This will created a hidden directory called .ssh that contains both your public (id_rsa.pub) and private (id_rsa.) key files. 

View your public key

  1. In the same Terminal window, type cat .ssh/id_rsa.pub. This will print your public key. (Note: if you are not using the default key filename, please substitute your public key name in place of id_rsa.pub).

  2. Copy this complete key, starting with ssh and ending with a username such as user@Admins-MacBook-Pro.local