gana2188 / google-cloud-sdk

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

SSH key not propagated to instance #102

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create an instance with

     gcloud compute instances create $GCLOUD_NAME \
    --project $GCLOUD_PROJECT \
    --image $GCLOUD_IMAGE \
    --machine-type $GCLOUD_MACHINE_TYPE \
    --zone $GCLOUD_ZONE \
    --metadata-from-file startup-script=/tmp/gcloud-startup.tmp > /dev/null

2. Try to upload a file

    gcloud compute copy-files ./mybinary $GCLOUD_NAME:/tmp \
    --project $GCLOUD_PROJECT \
    --zone $GCLOUD_ZONE

3. gcloud SDK generates files google_compute_engine/.pub in ~/.ssh/
4. Copy fails with

    Warning: Permanently added '130.211.165.53' (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].

What is the expected output? What do you see instead?

Usually this call succeeds. I SSHed into the machine from the web console and 
checked if there are any ~/.ssh/authorized_keys present for the user, but there 
are none - so I think something goes wrong when gcloud tries to upload the SSH 
public key.

What is the output of 'gcloud info'?

    Warning: Permanently added '130.211.165.53' (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].

Original issue reported on code.google.com by aigner.e...@gmail.com on 9 Jan 2015 at 10:03

GoogleCodeExporter commented 8 years ago
The same is also true for

    gcloud compute ssh

Original comment by aigner.e...@gmail.com on 9 Jan 2015 at 10:05

GoogleCodeExporter commented 8 years ago
If you run 'gcloud compute config-ssh' and use normal ssh to connect (eg "$ ssh 
$GCLOUD_NAME.$GCLOUD_ZONE.$GCLOUD_PROJECT"), do you see the same problem?

Original comment by jasm...@google.com on 14 Jan 2015 at 3:10

GoogleCodeExporter commented 8 years ago
Closing as invalid.  Please feel free to reopen with answer to jasmuth's 
question above.

Original comment by jeffvaug...@google.com on 20 Jan 2015 at 8:33