How to connect to your virtual machine via SSH in Linux

1. Prerequisites:

No. 1 Hosting

You need a Destination Earth hosting account with Horizon interface, depending on the cloud you are using:

1.1. Private and public keys have been created. The key files were saved on the local disk of the VM you wish to connect to. It is recommended to put the keys into the ~/.ssh folder.

If you need help, see How to create key pair in OpenStack Dashboard.

1.2. During the VM setup, the generated key we want to use was assigned.

For example, when you create an SSH key named testkey in the Horizon dashboard, its name will appear next to your VM.

../../../../_images/ssh_linux1.png

2. Connecting to a virtual machine via SSH

2.1. If your virtual machine has already been assigned a Floating IP (the instances menu next to your virtual machine lists the IP address), you can proceed to the next step.

If not, please follow the guide: How to Add or Remove Floating IP’s to your VM.

2.2. Go to the ~/.ssh folder where your SSH keys were saved to. Start your terminal (right click and click Open in Terminal).

2.3. Change permissions of the private key file. In the case of the file named id_rsa, type:

sudo chmod 600 id_rsa

Enter your password and confirm.

2.4. Once you have completed all of the steps above, you can log in. Let us assume that your generated and assigned Floating IP address in this case is 64.225.132.99. Execute the following command in the terminal:

2.5. The username in the terminal will change to eouser. This means that the SSH connection was successful.

../../../../_images/ssh_linux2.png

2.6. Troubleshooting

If you can’t connect to your virtual machine, check that you have the Security Group enabled to connect to SSH port: How to use Security Groups in Horizon.