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.
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
- Enter the
ssh-keygen -t rsacommand in the Terminal window, after which you will choose where to store the key after the ssh-keygen utility prompt appears.
- Choose the default location by pressing Enter.
- Type in a passphrase after ssh-keygen utility prompts you. You can choose the default one, but it is not advisable.
- 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.
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
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.
In case you see the prompt below, it could be because:
- You entered an incorrect passphrase
- You provided an incorrect public key in your desired system
- Your private key and your public key in your desired system do not match
$ ssh User@IP-Address