gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

Using gcloud compute copy-files from local to remote #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Trying to use gcloud to copy my local files to a remote instance.

What is the expected output? What do you see instead?
It should start copying my local files over to my vm instance.

What is the output of 'gcloud info'?
Mr-Sefesi:gr360 p$ gcloud compute config-ssh
You should now be able to use ssh/scp with your instances.
For example, try running:

  $ ssh gr360-0fld.us-central1-a.grassroots-360

Mr-Sefesi:gr360 p$ gcloud compute copy-files /Users/p/Dropbox/Websites/gr360 
p_sefesi.com@gr360-0fld:/var/www/ --zone us-central1-a
Warning: Permanently added '130.211.145.81' (RSA) to the list of known hosts.
Permission denied (publickey).
lost connection
ERROR: (gcloud.compute.copy-files) [/usr/bin/scp] exited with return code [1].
Mr-Sefesi:gr360 p$

Please provide any additional information below.

Original issue reported on code.google.com by p...@sefesi.com on 14 Feb 2015 at 9:57

GoogleCodeExporter commented 8 years ago
I believe the issue is that you are setting another user. gcloud compute 
copy-files creates and uploads an ssh key for your user. It then uses that key 
when it tries to connect. Since you are trying to connect as a different user, 
the key fails.

If you would like to upload as a different user, avoid using gcloud directly.

Original comment by stephe...@google.com on 18 Feb 2015 at 4:36