Cannot copy files from Cloud Shell to virtual machine as super user.
The following code works for me, but I cannot use it to copy files to the protected directories within the LAMP stack (i.e. /opt/bitnami/apache2/htdocs).
gcloud compute scp --project "[MY PROJECT ID]" ~/file.php lampstack-vm:~/file.php
If I try to use: gcloud compute scp --project "[MY PROJECT ID]" ~/file.php lampstack-vm:~/opt/bitnami/apache2/htdocs/file.php
I get the following error:
Permission denied (publickey). lost connection ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].