Connecting Google cloud Linux instances from windows putty

Cloud servers are physically inaccessible and it is only possible to connect to it remotely. Two of the most popular ways to access a cloud server are Remote Desktop Protocol (RDP) which is used to connect to servers running Windows OS and Secure Shell (SSH) which is used for Unix/Linux OS based servers. Here I would be focusing on connecting to Linux servers using PuTTY SSH client.

1)A Google Cloud VM instance. If you don’t have an instance then please click on below link to create a VM instance.
Create a VM instance on Google cloud

2)PuTTY SSH client & PuTTYgen. If you don’t have PuTTY client and PuTTYgen, please click on the below link to install PuTTY client and PuTTYgen.
Installing PuTTY client and PuTTYgen

3)Username for the cloud instance (e.g. john_dow ). You can enter anything as Username.

Assuming you have created an instance on google cloud and you also installed putty on your windows system.
A)Generate SSH key using PuTTYgen
1)First, open the PuTTYgen on your computer which is shown below.

2)Now Click on Generate which is shown below.

3)Now to Generate SSH key, please mouse over the empty box which is shown below.

4)Replace the username (e.g. john_doe) in the key comment field. Then enter a password and click on the Save private key to save private key which we will use later.

5) Do not close the PuTTYgen window.

B)Registering the SSH Public key with the instance.
1)Navigate to your Google instance page. The path is given below.

Click on Navigation menu -> PRODUCTS -> COMPUTE -> Compute Engine-> VM instances

2)Click on your VM instance name.

3)Click on Edit which is shown below.

4)Scroll down until you find SSH Keys and click on Show and edit which is shown below.

5) Now go to your PuTTYgen windows and  Copy the Public Key

6)After Click on show and edit in the instance, edit page. please Paste Public key which is shown below.

7)Finally, save the changes by clicking the save button below.

C)Connecting to the instance using the PuTTY SSH client:

1)First Open PuTTY. To open putty, please search PuTTY in your computer and click on PuTTY

2)Enter the username@externalIP in the Host Name field which is shown below.

3)On the left side of the PuTTY window, click on Auth and browse the Private key file path for authentication which we saved in step A.4.Click Open to open a terminal with a connection to your instance.

4) If the connection is successful, the terminal will prompt you for a password, enter the password which you used while generating the SSH keys.

D)Saving SSH configuration in PuTTY:

If you don’t save SSH configuration in PuTTY then whenever you try to connect VM instance you need to browse private key every time. So to avoid this we will save SSH configuration in PuTTY. please follow the following steps to save SSH configuration in PuTTY.
1)Open your PuTTY.
2)Now follow the following steps shown in the image.

3)To test your save SSH configuration. please close your PuTTY.
4)Now again open PuTTY
5)Now follow the steps shown in the following image.

Connecting to Instances Using Advanced Methods
Connecting to Instances

Prem Shamsundar

This post is contributed by Prem Shamsundar. If you like to contribute bytesofgigabytes, you can also write an article using bytesofgigabytes contribute . See your article appearing on the main page to help other people.

How to host a website on Google Cloud

How to host a website on Google Cloud

You may also like...

Leave a Reply