SSH Icon

Manually generating your SSH key in macOS

To generate an SSH key on macOS, you use the Terminal application. After the creation of a legitimate public SSH key and its upload, it is then copied by the desired location to allow your seamless login attempts.

Terminal
The terminal is a text-based command-line interface that communicates with the Unix shell of macOS.

To access the Terminal
• Open the Applications folder and choose Utilities
• From the Utilities list, find and open Terminal.

Generating an SSH key

There are two files in a SSH key:

  • The private key should always be kept secret.
  • The public key is the second half of the ssh key which will allow you to log in to the containers and the virtual machine you provide.

Use the ssh-keygen to store the generated keys in a safe place and use them to bypass the login prompt when accessing your instances.

Steps to follow

  1. Enter the ssh-keygen -t rsa command in the Terminal window, after which you will choose where to store the key after the ssh-keygen utility prompt appears.
  2. Choose the default location by pressing Enter.
  3. Type in a passphrase after ssh-keygen utility prompts you. You can choose the default one, but it is not advisable.
  4. Enter the passphrase a second time to confirm it and continue.

The system then generates the key pair.
Your identification has been saved in /Users/myname/.ssh/id_rsa.
You can now find your public key in the following location: /Users/myname/.ssh/id_rsa.pub.

Keygen SSH on a mac
Keygen SSH on a mac

The private key is saved in the id_rsa file of the .ssh folder and is used to confirm that the public key you use belongs to the correct system account while the public key is in the id_rsa.pub file.

Save this key to the clipboard by running pbcopy< ~/.ssh/id_rsa.pub

Importing your SSH key to Portal

• Return to your account page after copying the SSH key to the keyboard
• Paste the SSH key into the Public key field
• Give the ssh key a name In the ssh key name field.
• Finally, Add the ssh key. After which it will appear in the table of ssh keys.

Troubleshooting

In case you see the prompt below, it could be because:

  1. You entered an incorrect passphrase
  2. You provided an incorrect public key in your desired system
  3. Your private key and your public key in your desired system do not match

$ ssh User@IP-Address
User@IP-Address password:

Categories:

No responses yet

Leave a Reply

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