Connect to your VM (Linux) instance via an SSH client

You can connect to your VM instance using an SSH client. However, it varies depending on your operating system.

  • Linux: Search Terminal or press CTRL+ALT+T.

  • macOS: Search Terminal.

  • Windows: Search Bash. If you do not have it installed, use PuTTY instead.

Follow these steps to connect to your VM:

  1. Open the terminal window on your local computer and enter the SSH connection command below. After the @, add the IP address of your VM instance. Next, press ENTER.

ssh root@192.0.2.1

For a private key, ensure that you have the location of the private key (.pem file), the username, and the public DNS name. Enter the following command:

ssh -i /path/key-pair-name.pem instance-username@instance-public-dns-name

Note: — When you log in for the first time, your local machine does not recognize the server, so you will be prompted to continue the connection. You can type yes and then press ENTER.

  1. Authentication is the next step in the connection process. You will be able to connect to the VM immediately if you have added the SSH keys or after entering your key pair's passphrase.

If you have not already added SSH keys, you will be prompted for your password:

root@192.0.2.1's password:

The terminal remains empty for you to paste the initial password into. Pasting into text-based terminals is different from desktop applications. It is also different from one window manager to another:

  • For Linux Gnome Terminal, use CTRL+SHIFT+V.

  • For macOS, use the SHIFT-CMD-V or a middle mouse button.

  • For Bash on Windows, right-click on the window bar, choose Edit, then Paste. You can also right-click to paste if you enable the QuickEdit mode.

  1. Press ENTER after you enter the password.

Result: You can log in to your VM instance if the SSH key is configured correctly.

Last updated