Skip to main content

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





Popular posts from this blog

Autofill Dynamic Dropdowns Using Spring Jquery Ajax

This explains on how to populate values in a drop down based on a value selected on another drop down. But you can configure it load values dynamically when click on link or any other action performed (based on your requirment) Include JSTL tag library in your JSP Page 1 <%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> Use JSTL to call the required URL path through Spring bindings 1 < c : url var = "findProductForCat" value = "/products_ajax.do" /> HTML and EL code to enter in JSP page. 1 2 3 4 5 6 7 8 9 10 <select class= "select-width" id= "category_list_d" > <option value= "" > Select Category </option> <c:forEach var= "catList" items= "${category_lst}" > <option value= "${catList.categoryId}" > ${catList.categoryName } </option> </c:forEach> ...

Java Version and New Features 8 - 13

Introduction Introduction Java is widely used staticly typed programming language which is founded over 25 years back. It's almost everywhere from home appliances, mobile devices to industry scale systems. Java is evolving over the time and from Java 8 onwards there were major changes introduced to the language. Below are the list of all the changes on each version. Imperative vs Declarative Programming Imperative approach is defining step by step on HOW we are going to achieve the end result. Declarative approach is describing WHAT we want as the output. Simple example would be a classical for loop in Java which we can call as imperative programming and a select query in sql as declarative programming. ...

Java 5

Java 5 is known as the “ Tiger ” release since it released many of the key features many of the developers used today. Many interview questions are based on this version. Following are the key features introduced in Java 5 Generics Annotations Autoboxing / Unboxing Typesafe Enums Varargs Foreach Loop Static Imports Scanner Class Assertions StringBuilder