How to Create SSH Keys with OpenSSH on macOS or Linux
How to Create SSH Keys with OpenSSH on macOS or Linux
Solidus AITECH Compute Marketplace GPU instances are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each GPU instance you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure.
The standard OpenSSH suite of tools includes the ssh-keygen utility, which is used to generate SSH key pairs. Run this utility on your local computer to generate a 2048-bit RSA or ED25519 key pair, which is suitable for most use cases.
Generate an SSH Key Pair
The OpenSSH toolset includes the ssh-keygen command, which is responsible for creating SSH key pairs. You can run this command on your local machine to generate a 2048-bit RSA key pair, which is sufficient for most common scenarios.
ssh-keygenWhen the command runs, you are asked to choose where the key files should be saved. If you do not change anything, the keys will be placed in the ~/.ssh folder using the default names id_ed25519 (private key) and id_ed25519.pub (public key). Keeping these default paths allows your SSH client to locate the keys automatically during login, so it is recommended to press ENTER to proceed with the defaults.
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/username/.ssh/id_ed25519):If an SSH key pair already exists on your system, the tool may display a warning similar to the following (Choosing to replace the existing key will permanently invalidate the old one, meaning it can no longer be used for authentication. Confirming this action is irreversible and will overwrite the previous key files.):
/home/username/.ssh/id_ed25519 already exists.
Overwrite (y/n)?'After confirming where the key will be saved, you are asked to set an optional passphrase to protect the private key file. This passphrase encrypts the key on disk.
If you choose to set one, it must be entered each time the key is used, unless an SSH agent is running and has already unlocked it. Using a passphrase is recommended for additional security, but you can press ENTER to skip this step.
Created directory '/home/username/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:Once this step is complete, the key generation process finishes and you will have both a public key and a private key ready for authentication.
Your identification has been saved in /home/username/.ssh/id_ed25519.
Your public key has been saved in /home/username/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:v/d5p9UJP2dx5G4dSUN92OXA5jgBpRxidE62EXAMPLE username@203.0.113.0
The key's randomart image is:
+--[ED25519 256]--+
| E== *o...++|
| o.+ O +. =o+|
| . * = o+|
| . .o ooo|
| S . o +o|
| . o.B|
| . +O|
| .. ==|
| .. .+o.|
+----[SHA256]-----+
