DEV Community

Mushfiqur Rahman Shishir
Mushfiqur Rahman Shishir

Posted on

Enable File Transfer on Google Cloud Compute Engine

After installing WordPress on Google Compute Engine, you might need a way to transfer files to the VM. It’s great to have worked on the local machine and upload the changes via file transfer protocol. File transfer protocol needs to be activated first. Then you can use it via any FTP client.

The first obstacle you’ll face after setting up a VM instance is how to transfer files to your Google Cloud VM. It is very obvious because google cloud does not have any shiny option on their dashboard. The basic transfer option is hidden in the SSH section of your VM Instances.

Other than the basic option there are three ways which you can follow to transfer files to Google Cloud. First, using Google Cloud SDK Tools. But that said this option is worse than before, for a newbie. You have to execute the command to transfer a simple file.

Second, using FTP (File Transfer Protocol), but Google Cloud VM instance does not come with a pre-installed FTP server, so you have to set up an FTP server, in order to connect to Google Cloud using FTP.

Third, using SFTP (SSH File Transfer Protocol) which we are going to discuss in the blog. SFTP is more secure than FTP and because Google Cloud instance came with SSH, you don’t need to install anything on your VM instance to transfer files using SFTP.

WHAT IS DIFFERENT BETWEEN FTP AND SFTP?

FTP stands for “File Transfer Protocol”. And SFTP stands for “SSH File Transfer Protocol” OR “Secure File Transfer Protocol”.

The main disadvantage of using FTP protocol is security. FTP uses two separate channels, both of which are unencrypted, this means that the information from either of the channel can be intercepted and accessed.

SFTP ensures that data is securely transferred using a private and safe data stream.

It is wise to not have a huge security loophole in your server, that is why you should use only SFTP rather than Ftp. And by the way, Google Cloud does give a click ready FTP setup option.

WHAT IS PUBLIC AND PRIVATE KEYS.

To set up Sftp you need to generate SSH keys pair. These keys pair will help you to encrypt and decrypt data.

Public key: You will add or copy this key to your Google Cloud Metadata. This key will encrypt data which can then only be read by the person who holds the corresponding private key.

Private key: This key file should only remain within your PC. Only a user in possession of a private key that corresponds to the public key at the server will be able to authenticate successfully.

WHAT IS FILEZILLA?

FileZilla is free software, cross-platform FTP / SFTP application, Two different versions of it is available one is Filezilla client and another Filezilla server. You will be using Filezilla client in this tutorial. Filezilla client is available for Windows and macOS.

FOR WINDOWS PC: If you are a windows user then the easiest way to generate RSA keys is through PuttyGen. Yes, you can generate a public and private key with other application e.g.. Google SDK etc.

GENERATE PUBLIC AND PRIVATE KEYS

To generate Public and private RSA key follow these steps below:

  • Download and install PuTTy.
  • Generate Public and private keys using Puttygen.
  • Add Public key to Google Cloud. Use one public key for only one VM Instances or use one public key for all the VM Instances.

Read the full article here.

Thanks for reading and please do share if you like it.

Top comments (0)