GCE ssh uses public key authentication, not passwords, so you have the following options:
use
gcloud compute copy-files
as described in this answer. This is likely easier as it will allow you to specify projects and host names symbolically, as the IP addresses may change.use
sftp
as described in this answer, namely:sftp -o IdentityFile ~/.ssh/google_compute_engine user@host
use
ssh
but with a full path to the key file registered with GCE. This command is printed out when you rungcloud compute ssh <instance>
so you can just copy-paste it and use it later. It should resemble the following:ssh -i ~/.ssh/google_compute_engine \ -o UserKnownHostsFile=/dev/null \ -o CheckHostIP=no \ -o StrictHostKeyChecking=no \ USER@IP_ADDRESS
Note that here you will have to use exact IP addresses here, so consider either using static IP addresses or DNS to create a constant name for possibly-varying IP addresses (if you're using dynamic IPs).
You can read more in the documentation.