Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Trouble With SFTP

I'm having trouble with SFTP. I opened Google SDK shell and authenticated. After that I pasted the gcloud command from my Virtual Instance. The keys were added to my Instance under meta data and they were downloaded to .ssh folder in Windows. I added a connection in FileZilla and placed the private key in, the one without an extension. There was a .ppk key there already.

.ppk and .pub have a username different than what I get running whoami command. I also get a different username running whoami in Google Cloud SDK from windows than what I get running the command in SSH Browser in Console. The key files have username laptop/[what I see running whoami Windows SDK]. The extenionless key has no username listed, just a random string. As for password I set one using sudo passwd command. 

Alternatively I'm looking for a way to list the files and folders on my LAMP via SSH Browser from Console, like DIR command in DOS. I can't seem to find a suitable command. I could possibly upload the files by hand there if I could see what was going on. Then I could see how the server changes when I create disc, ect.

I'm really confused and don't know what to do if I can't see my folders and files. There's Windows, Linux, three key files. Maybe Google should give us a file manager in console. Who can I solve this? 

0 3 421
3 REPLIES 3

Okay. I got some of this sorted out. I found the unsername for those keys and some new keys I tested from PuTTyGen. My remote site connection in FileZilla is weird though. The directory is ? -> Home -> a bunch of folders with usernames. In them are an .ssh folder and a .bash_logout .bash and .profile. I'm not sure what this has to do with my LAMP installation though. I don't see folders var/www/html or whatever.

Howdy Jeremy,
Maybe an overview of your setup would help.  I am hearing windows machines, linux machines and LAMP stack.  Are all of these machines Google Cloud compute engine instances?  Lets get a description of your desired setup and take the pieces apart slowly and see if we can't get a resolution.  Let's start with what you want to SFTP into.  Can you describe that in more detail?

Sorry. I ended up solving this. I'm using a windows laptop at home, running a linux VM.

The problem was a username issue. Each key has a username, and like I said I was getting a different username each place I requested one. So trying them all I found the one that went to the key. For others having this issue PuTTygen will create a private key. The string supplied goes in Computer Engine -> Meta Data. Save the key as a file from PuttyGen. Login with a FileZilla connection using the same .ppk from PuTTygen and your external IP.