Turns out google's invocation of scp
was omitting the correct username.
Solution
I successfully uploaded by doing
/usr/bin/scp -P 6000 -i /Users/me/.ssh/google_compute_engine -o \
StrictHostKeyChecking=no ~/Sites/my-app/bigfile \
cj@35.185.184.136:~/big_file
How to figure this out
I was able to discover this using the --verbosity debug
flag
# gcloud alpha cloud-shell scp --verbosity debug localhost:~/Sites/my-app/big_file cloudshell:~/big_file
DEBUG: Running [gcloud.alpha.cloud-shell.scp] with arguments: [(cloudshell|localhost):DEST: "cloudshell:~/big_file", (cloudshell|localhost):SRC:1: "['localhost:~/Sites/my-app/big_file']", --verbosity: "debug"]
DEBUG: Running command [/usr/bin/scp -P 6000
-i /Users/chrisjensen/.ssh/google_compute_engine
-o StrictHostKeyChecking=no
~/Sites/my-app/big_file 35.185.184.136:~/big_file].
[...more debug info...]
^ This is the line that shows the command that was run
Then I ran ssh
to see if there was a difference in the arguments
gcloud alpha cloud-shell ssh --verbosity debug
DEBUG: Running [gcloud.alpha.cloud-shell.ssh] with arguments: [--verbosity: "debug"]
DEBUG: Running command [/usr/bin/ssh -t -p 6000
-i /Users/chrisjensen/.ssh/google_compute_engine
-o StrictHostKeyChecking=no cj@127.0.0.1].
[...more debug info...]
^ Notice it prepends by username to the server ip.
So then I copied the scp command and added my username, and it worked a charm.
Hope this helps others trying to figure this out.