Failed to install directory in Google Compute Engine using sshfs

I am trying to mount a remote file system in the Google Container Engine. I follow this guide: https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh

Using the following sshfs command:

sudo sshfs -o sshfs_debug,allow_other <instance-name>.<region>.<project_id>:/home/<user_name> /mnt/gce-container

I get an error:

SSHFS version 2.5
read: Connection reset by peer

I referenced this link https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh and can log in using ssh with the following command:

$gcloud compute config-ssh
$ssh <instance-name>.<region>.<project_id>

Any ideas what might be wrong here? I cannot figure out which keys and username to use to login to sshfs.

Update (11/5): I use the following command:

sshfs -o IdentityFile=~/.ssh/google_compute_engine <user>@<ip>:~/  /mnt/gce`

chowned/mnt/gce . , IP ~/.ssh/config. read: Connection reset by peer

+4
3

,

1), IP-,

2) .pub

sshfs -o IdentityFile=~/.ssh/google_compute_engine <user>@<ip>:~/  /mnt/gce

, , , :

sudo mkdir /mnt/gce
sudo chown <user> /mnt/gce

sshfs -o  IdentityFile=~/.ssh/google_compute_engine.pub <user_name>@<instance-name>.<region>.<project_id>:/home/<user_name> /mnt/gce
+2

, :

  • sshfs root. FUSE .
  • FS. SSH, $PWD $HOME.

ssh , sshfs . - , ~/.ssh/config , ..

0

If you get it from sshfs

read: Connection reset by peer

may help install read-only file

chmod 400 /{{path_to_your_key}}/keypair.pem

and reconnect.

0
source

All Articles