Skip to main content

Guide to Generating and Using SSH Keys

Secure Shell (SSH) keys are an essential tool for secure communication between your computer and a remote server, like a GPU VM on Ori VMs. This guide will walk you through generating your own SSH key pair, which consists of a public key and a private key, and how to use it.

Step 1: Generating the SSH Key Pair

On Windows

  1. Using PuTTYgen:
    • Download and install PuTTY, which includes PuTTYgen, from the official site.
    • Open PuTTYgen.
    • Click on “Generate” and follow the instructions to create a new key. Usually, this involves moving your mouse around the blank area to generate randomness.
    • Once the key is generated, you will see the public key displayed in the window.
    • Save the private key to your computer by clicking “Save private key”. It’s advisable to use a passphrase for added security.

On macOS and Linux

  1. Using Terminal:
    • Open Terminal.
    • Run the command: ssh-keygen -t rsa -b 4096. This creates a new RSA key pair with a 4096-bit length, offering strong security.
    • Follow the prompts to choose where to save the key and enter a passphrase for added security.

Step 2: Locating Your SSH Key

  • After generation, your public key will be located in the specified directory (default is usually ~/.ssh/). The public key file is typically named id_rsa.pub.

Step 3: Using SSH Key with Ori VMs

  1. Copying Your Public Key:

    • Open the public key file with a text editor and copy the entire contents. It's a single line of text starting with ssh-rsa.
  2. Adding Key to Ori VMs:

    • In the Ori VMs interface, when launching a new VM or accessing existing ones, look for a section to input SSH keys.
    • Paste your copied public key into the designated field for SSH keys.

Step 4: Connecting to the VM

On Windows

  1. Using PuTTY:
    • Open PuTTY.
    • Enter the VM's IP address and specify the port (usually port 22 for SSH).
    • Go to “Connection” > “SSH” > “Auth” in the PuTTY configuration and load your private key file.
    • Click “Open” to initiate the connection.
    • If prompted, enter the username for your VM and the passphrase for your private key.

On macOS and Linux

  1. Using Terminal:
    • Open Terminal.
    • Use the command ssh username@vm_ip_address -i /path/to/private/key, replacing username, vm_ip_address, and /path/to/private/key with your VM's username, its IP address, and the path to your private SSH key, respectively.
    • If it's your first time connecting, you'll be asked to confirm the server's authenticity. Type yes to continue.
    • Enter your passphrase if you set one.

Conclusion

You now have your own SSH key pair and know how to use it to securely connect to a VM on Ori VMs. Remember to keep your private key secure and never share it. Your public key is what you provide to services like Ori VMs for secure access to your VMs.