0

I am trying to download files from a particular folder from one of my vm's on gcp using the following command

gcloud compute scp --recurse VM_NAME:REMOTE_DIR LOCAL_DIR

After running the command the gcp terminal asks me for a passphrase.

I enter the passphrase and get a message saying

ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].

My qs: How do I change or update the passphrase?

Note: The passphrase was set by running the following command: gcloud auth login

What I have already done?

  • Tried restarting and reloading apache2.
  • Searched online for the issue using popular search engines.
  • The solution mentioned here How do I change my private key passphrase? will not work because it asks for the old passphrase to change it
  • Can you describe how exactly did you set the passphrase ? Are you connecting from your local machine or some other VM in the same VPC ? – Wojtek_B Jun 29 '21 at 14:31
  • By running this command gcloud compute scp --recurse VM_NAME:REMOTE_DIR LOCAL_DIR on the lamp vm terminal – user4540741 Jun 29 '21 at 16:37
  • The command `gcloud auth login` does not set the passphrase for a VM. Google Cloud VMs do not use passphrases. They use SSH keypairs. – John Hanley Jun 29 '21 at 18:43
  • if you run gcloud auth login in the VM terminal it will show a link, if you click on the link it will share an alphanumeric code which you need to copy and enter in the terminal. It then asks if the zone and the project id are accurate, after that it asks for a passphrase and in this step, it has 2 options one for entering a passphrase or to keep it blank. You can fire up a lamp VM and check for yourself. – user4540741 Jun 29 '21 at 19:01
  • You are confusing Google Cloud Authorization with SSH server authorization. Google Cloud VMs are assigned a service account. There is no need to run the command `gcloud auth login` unless you want to use different credentials. Sometimes reading the documentation will help you use a service effectively. – John Hanley Jun 29 '21 at 19:04
  • You can try for your self and see , the question is how do I change the passphrase? Without the passphrase I cannot run the gcloud compute scp --recurse VM_NAME:REMOTE_DIR LOCAL_DIR command on the lamp vm terminal – user4540741 Jun 29 '21 at 19:13

1 Answers1

1

You have an issue with a proper ssh-key authorization. You may actually try the gcloud compute config-ssh first but I'd advise to go through the answers and documentation first to understand what you're doing.

I've found two answers for a similar questions that may help you:

Also have a look at the documentation that describes authorising ssh to your VM's:

Wojtek_B
  • 931
  • 3
  • 12