connect VM using private key and SFTP in WinSCP

How to connect VM using private key and SFTP in WinSCP ?

This tutorial guides you on how to connect VM using private key and SFTP in WinSCP. For our exercise let’s assume a virtual machine (VM) instance is up and running in Google cloud.

How to connect VM using private key and SFTP in WinSCP

Let’s say you have generated SSH keys (private and public keys) using some tools. For example, I have generated SSH keys using PuTTYgen and used the public key to setup SSH Keys for the VM instance running in Google Cloud.

Basically, I followed the steps mentioned in this article to Add or Remove Project-Wide SSH keys in the Google Cloud Platform for the VM instance.

Also, I saved the private key in local machine. Now, I am going to tell you how to use this private key in WinSCP to connect to the VM using private key via SFTP in WinSCP.

First, you need to download and install WinSCP using this link : Download WinSCP.

Next, open WinSCP and choose “New Site” so that you can enter session details. Choose “SFTP” from the “File protocol” dropdown.

Then enter “Host name” details. I have entered static ip (44.121.66.21) of the VM instance. And by default the port number will be 22 when you choose SFTP protocol. Do not change the port leave as it is as shown below.

connect VM using private key and SFTP in WinSCP

And you can mention username (root) using which you are going to connect or login.

Then click “Edit” -> “Advanced” and select “Authentication” under “SSH” section. After that, browse for the private key (private_root.ppk) with which you are going to connect VM instance securely and click “Ok” as shown below.

connect VM using private key and SFTP in WinSCP

Finally save the changes made and hit “Login” button to connect.

That’s it. You should be able to connect to virtual machine instance using private key generated via SFTP in WinSCP.

Hope it helped 🙂

References

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments