Access Your VM Instance Using PuTTY (Windows)

Once you have created a VM Instance using Horizon, you can access this VM Instance through a secure shell (SSH) using an SSH key pair. For Windows users, the CADES team recommends PuTTY. The PuTTY MSI installer also includes PuTTYGen, which allows you to convert a .pem private key file to a .ppk PuTTY key file.

If you would like to access your VM Instance over SSH from outside of the ORNL network, you must first create a firewall (SAFER) exception for this purpose. All local (within the ORNL network) SSH connections are permitted by default.

Add SSH Keys to a VM Instance

If you do not have any existing SSH key pairs, or you wish to generate a new key pair for your VM Instance, then you should use the Horizon web GUI to generate a new SSH key pair (Option 1). If you do have an existing key pair on your machine, then you can import the public key using the Horizon web GUI (Option 2).

In either case, you will need to log into the Horizon web GUI to associate your SSH key with your VM Instance(s).

Log in to Horizon

  1. Navigate to the Horizon web interface at https://cloud.cades.ornl.gov/.
  2. Log in with your UCAMS credentials.
    • Domain: ornl
    • Username: Your three-letter UCAMS ID
    • Password: Your UCAMS password

Option 1: Generate a New Key Pair

  1. Within Horizon, navigate to ProjectComputeAccess & SecurityKey Pairs.
  2. In the Key Pairs screen, click the + Create New Pair button.
  3. In the resulting dialog, name your Key Pair, and click Create Key Pair when you're finished. We went with blackmesakey in this example.
  4. The private key will be downloaded to your local machine as a .pem file. The public key will be stored in OpenStack.
  5. Place the downloaded private key in a directory of your choosing, e.g., C:\Users\Username\SSH.

📝 Note: The private key is in a .pem format and has to be converted to a .ppk file using PuTTYGen.

Having completed the procedure above, you can now connect to your Instance using PuTTY.

Option 2: Import an Existing Key

If you have an existing key pair that you would like to also use for your OpenStack Project, then you can import the public key using the Horizon web GUI.

  1. Within Horizon, navigate to ProjectComputeAccess & SecurityKey Pairs.
  2. In the Key Pairs screen, click the Import Key Pair button.
  3. In the resulting dialog, enter a key pair name in the Key Pair Name field.
  4. On your local machine, locate your public key file and open it with a text editor.
  5. Copy the key to your clipboard using the text editor.
  6. Back in Horizon, paste the public key into the Public Key text box.
  7. Click the Import Key Pair button.
  8. Confirm your newly imported key appears in the Key Pair list.

Having completed the procedure above, you can now connect to your Instance using PuTTY.

Download and Install PuTTY

  1. Navitage to the official PuTTY download page.
  2. Download the appropriate MSI file for your Windows system (32 bit or 64 bit).
    • Alternatively, if you don't want to "install" PuTTY on your system, you can download putty.exe and puttygen.exe from the "Alternative binary files" list and execute them as needed.
  3. Run the PuTTY MSI installer. Note the destination directory.
  4. Confirm installation of PuTTY executables.

Connect to Your VM Instance Using PuTTY

Find Your Instance's IP

The IP address of your VM instance is shown in the Instances tab in the Horizon web GUI.

  1. Navigate to ProjectComputeInstances.
  2. From the Instances screen, you can copy the IP address for the desired VM Instance.

Convert Your Private Key to PuTTY Format

If you generated a key in the .pem file format, then you need to convert that key to the .ppk format using PuTTYGen.

  1. Locate and execute PuTTYGen.exe.
  2. Click the Load button.
  3. In the resulting dialog, navigate to the location of your key file.
  4. Select All Files (*.*) to show .pem files in the dialog.
  5. Select the appropriate key file and click Open.
  6. When prompted by the success message, click OK.
  7. Save the loaded key by clicking Save private key.
  8. Using the resulting dialog, save the key in an intuitive place (e.g., C:\Users\Username\SSH).

Your key is now saved as a .ppk file that can be loaded directly into PuTTY, and we can now use PuTTY to connect to your VM Instance, without a password, using the "cades" username.

Connect to Your Instance

First we're going to load the .ppk key file into PuTTY.

  1. Locate and execute PuTTY.exe.
  2. In PuTTY's navigation pane, go to ConnectionSSHAuth.
  3. In the "Options for controlling SSH authentication" screen, click Browse.
  4. In the resulting dialog, find your .ppk file, and click Open.

Your key file is now loaded into PuTTY. Next, we need to add your host information.

  1. In PuTTY's navigation pane, click Session.
  2. In the Host Name (or IP address) field, enter the IP address of your VM Instance preceded by "cades" (e.g., cades@128.219.186.42).
  3. Ensure that the SSH radio button is selected and the port is set to 22.
  4. You can save this configuration by providing a name under Saved Sessions and clicking the Save button. This obviates the need to configure PuTTY for your instance each time you want to access it. This name need not match the name of the instance on Horizon.
  5. Click Open to connect to your VM Instance using SSH.
  6. If prompted, you can choose to cache the server's fingerprint (click Yes), not to cache the server's fingerprint for this session (click No), or to reject the connection outright (click Cancel). We're going to click Yes.
  7. You should now have access to your VM Instance's Bash terminal.

Related Tutorials