Managing SSH keys

You can use public/private key pairs to authenticate with your Linux virtual machines.

Generating SSH keys

Windows

The most popular way to generate public/private key pairs on Windows is to use PuTTYgen (available from the official site).

PuTTYgen

To generate new key pairs, click on the Generate button and then move your mouse around the blank area to generate randomness.

Generating new key pair

After generating the key pairs, a public key will be visible at the top of the window. This is the key you need to paste in OneStepCloud. To authenticate with a virtual machine, you'll need a private key. To save your private key, click on the Save private key button.

Generating new key pair

Linux

To generate public/private key pairs on Linux, open a console and type:

ssh-keygen -t rsa -b 4096 -f onestepcloud

Type a password to protect your keys and wait for keys to be generated. After it's finished, two new files will be created:

  • onestepcloud - your private key file,
  • onestepcloud.pub - your public key file that has to be pasted in OneStepCloud.

Viewing SSH keys

To view your public keys, go to SSH keys tab in Settings category.

List of SSH keys

Adding SSH key

To add new SSH key, click on the Add SSH key button. Fill in the title and key fields and click on the Add key button.

List of SSH keys

Deleting SSH key

To delete SSH key, click on the trash icon.

Adding SSH key to virtual machine

It's only possible to add SSH key to a virtual machine when it's not yet configured. Go to the virtual machine configuration window, check Use private key for authentication checkbox and select public key from the list.

Configuring key authentication

Using private key to authenticate

Windows

>

If you have OneStepCloud or OpenSSH generated key (and if you want to use PuTTY)

Open PuTTYGen (PuTTY Key Generator) from PuTTY suite

PuTTYGen

Select "Conversions" => "Import key" and find your key.

PuTTYGen Import key

Click "Save private key" and choose location to save the key file on your computer.

PuTTYGen Save Private Key

>

Configuring SSH authentication using a private key is dependent on using a SSH client. In case of Windows, most popular SSH client is PuTTY. Open PuTTY, type the public address IP and select SSH protocol.

Generating new key pair

Next, select Connection -> SSH -> Auth tab and browse for your private key.

Generating new key pair

Now go back to the Session tab, type the name for this session and click Save.

Generating new key pair

Linux

To SSH to your virtual machine using a private key, open a terminal and type:

ssh -i location_to_onestepcloud_private_key username@public_address
Last updated on 28th Jun 2017