VM SSH Keys

SSH is commonly used to provide secure connectivity to Linux and Unix VMs once they are deployed.

When deploying UNIX VMs, the default behavior is to disable password authentication and only allow SSH key authentication. Before creation of such a VM, a public SSH key will need to be generated and pasted under the Settings of VM Squared.

Generate a public SSH key from the command line

Before you can use key-based authentication you will need to have a key on your own system.

From the local machine’s terminal, use the following command to create a private (id_rsa) and public (id_rsa.pub) key pairing:

ssh-keygen -t rsa -b 4096

Where -t rsa declares the RSA encryption algorithm and -b 4096 declares the encryption bit sizing.

You will be prompted to choose where to save the files and if you would like to include a passphrase. Just press enter to bypass these inputs.

Retrieve the public key and enter into your user settings

Once the command has run and returned to input, navigate to the file, .ssh/id_rsa.pub and open it in your text editor of choice.

Navigate to your user settings page, and click on the SSH public key field.

Copy the public key to paste into the SSH public key field:

Settings Auth Pub SSH Key

This is important to configure before beginning to create VMs because these key pairs are what allow a user to log into a VM.

The ssh key is injected when VM Squared first starts the VM.

Updating SSH key for other users

You can add SSH keys to the accounts for other users from the System -> Users page.

Select the user you want to update and choose the Authentication tab. Click Edit Public SSH Key to update the key

Settings Auth Pub SSH Key for other users