Tuesday, March 5, 2024

How to Setup SFTP Server Using GCP VM With a Mounted GCP Bucket


SFTP is the secured method of implementing FTP where you can use a server or storage location as FTP location which you can transfer files from your local computer to remote server. In this article we discuss how to create a SFTP server using GCP (Google Cloud Platform). 
Even though the best way is to use a GCP bucket which is low cost for large file storage in GCP theres no direct way to implement a SFTP connection directly to the bucket. Therefore we need to have a VM (Virtual Machine) in GCP in order to act as a server for file transfers. 

Generate SSH keys

Generate the SSH keys using following command. This generates a public key and a private key which we going to use later.
    • ssh-keygen -b 4096 -t rsa

Create VM in GCP

First of all you need to create a GCP account here which they provide $300 credit for new users which is enough for you to get start for free.
To create a VM you need to access Compute Engine and VM instances. 


Create Bucket
Login to Gcloud
Setup OS Login
SSH to user account
Create SFTP User
Update SSHD Configs
Login to the SFTP User
Create Folder Path 
Install GCS Fuse
Mount Bucket to VM using GCSFuse





How to Setup SFTP Server Using GCP VM With a Mounted GCP Bucket

SFTP is the secured method of implementing FTP where you can use a server or storage location as FTP location which you can transfer files f...