简体   繁体   中英

cannot find file on home directory after successfully uploading via gcloud compute scp

I tried to upload a file called kaldi.sh to google cloud virtual machine.

So I tried gcloud compute scp kaldi.sh vandys-0:~/experiment as guided here https://cloud.google.com/compute/docs/gcloud-compute/ . To be more specific: kaldi.sh is the file I'd like to upload, vandys-0 is my instance name, and experiment is the directory I would like to upload into.

The code runs well but when I activated the google cloud vm shell and entered into directory with path ~/experiemnt (the same as /home/[username]/experiment I believe? ). I found nothing from ls in the experiment directory.

I tried to use gcloud compute scp kaldi.sh [username]@vandys-0:~/experiment in the command instead. But it failed with error :

[username]@35.196.87.176: Permission denied (publickey).

lost connection

Any idea could help.

A VM instance of a compute engine is distinct from the virtual machine used to run the cloud VM shell. When you launch the cloud VM shell, that spawns its own (unique) instance of a virtual machine. The purpose of the shell is simply to provide an environment in which you can run gcloud (or similar) admin commands. What I think has happened is that you uploaded your file to your real compute engine instance and then opened up the cloud shell which would result in a separated (unrelated) instance being spawned for you. These won't share file system data and hence it appeared that your file was missing.

To access the VM Instance to which the files were copied we can use the SSH window from the console browser. The SSH window can be opened from the GCP console on the VM Instances page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM