How to Save SSH Keys on Mac

In this tutorial, we will guide you on how to save ssh keys on mac.
Public key cryptography is used by SSH to authenticate the remote computer and similarly authenticate the user if required. There are various ways to use SSH. The first way is to make use of the public private key pairs that generated automatically so as to encrypt a network connection after which password can be entered for authentication to log on.
The other way is to generate the public private key manually so as to perform authentication which allows different users or programs to log in without providing a password. This way, anyone can generate a pair of matching keys (private and public).
To learn how to save ssh keys on mac follow the tutorial given below.


Step 1 – Enter the command

First of all, let’s open up the terminal application and type the command
ssh-keygen –t rsa

Insert the command

Step 2 – Create default ssh path

With that done, it will ask you to enter the file path where you want to save the key. For now, let’s leave it blank and hit return. This will create the key on the default ssh path.

Form a default ssh path

Step 3 – Overwrite an existing key

If you want to overwrite an already existing key, press Y on the keyboard and hit return.

Overwrite an already present key

Step 4 – Paraphrase the key

With that done, you will be asked to enter the passphrase. You can leave it blank if you don’t want any passphrase for the ssh keys on mac.

Enter the paraphrase

Step 5 – Add key to ssh directory

Now that the ssh key has been generated, let’s add the key to the ssh directory. For that, you can use the command:
ssh-add and hit return

Enter key to ssh directory

Step 6 – View the recently added key

If you want to see the recently added key, you can use the ssh-add command with the–l switch. Over here, you can see the recently added ssh key being displayed on the screen. This means that the ssh keys on mac have been successfully saved.
And that’s it.

See the recently added key