I have been playing around with Debian on Compute Engine and was wondering how I could SFTP into the server. I can't find any documentation on it and was hoping someone could point me in the right direction.
Thanks!
If this isn't possible, is the best way to manage static sites through SCP?
I gave up with gcloud compute copy-files as I couldn't figure out why my instance was not been fetch and something with insufficient permissions, then I started looking into how to sftp into my gcloud instance
this is how I got this to work with filezilla
first I downloaded and run the gcloud sdk : https://cloud.google.com/compute/docs/gcloud-compute/#install
when I first try to connect to an instance from my terminal I was prompted to to create ssh keys, I'm on a mac so the keys were setup in /Users// folder under .ssh/ folder
I got the google_compute_engine private key from the .ssh/ folder and imported that into felizilla > settings > sftp
the host is the ip address of my gcloud vm instance, the user is whatever your username is once you connect to the instance via ssh.. check the prompt: [@]$, your key should be your method of authentication. your remote directory is the same as /home//, server type is unix (I had centos vm in google cloud)
Once my files were uploaded into my directory on my instance from my computer I was able to mv them to wherever I needed those files to be within the gcloud vm instance.
I was again a happy camper.
sources: http://winscp.net/eng/docs/guide_google_compute_engine
ssh, scp and sftp should all work if you specify the instance's IP address. You can use DNS for this if you have a static IP address, or you can use the IP address from
gcutil listinstances
or the console.Once you know the IP address of the instance, you'll also need your ssh private key, which is usually at
~/.ssh/google_compute_engine
. Then you can connect viasftp
as follows:If I understand the question, you want have a SFTP in a instance with Debian.
Try this tutorial
Open the the port 22 in the firewall:
gcutil addfirewall port-22 --description="Open up port 22." --allowed="tcp:22"
Test with Filezilla Client establishing a SFTP connection.
Have Fun :)
On a Mac or linux OS, use the "gcloud compute config-ssh: command. This will setup the conf file in you .ssh dir and allow you to use ssh, scp & sftp using the alias that is configured in the config file.
gcloud doc for config-ssh https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh
You can upload and download files with
gcloud compute copy-files
, e.g., upload via:and download via:
The
gcloud
tool is included in the Google Cloud SDK and comes preinstalled in standard Google Compute Engine VM images.Seem that google computer engine already has SFTP service by default. Following is an excellent step by step instruction using WinSCP as SFTP client to connect to the service. It works perfectly for me on first try.
http://winscp.net/eng/docs/guide_google_compute_engine
Same principle should applies using other FTP client software. Hope will save someone time and effort.