Sshfs “Connection reset by peer” with identify file

amazon ec2linuxsshsshfs

Time to time I need create servers network – link servers and quickly copy data.

I'm using for that SSH Filesystem (SSHFS) because it is simple and easy to use like connect with Secure Shell (SSH).

For better security reasons I using authentication files instead of passwords. Another reasons is that is the default setting for "Amazon Web Services (AWS) EC2".

Time to time I don't figure out where is problem with connection

sshfs {{user_name}}@{{server_ip}}:{{remote_path}} {{local_path}} -o "IdentityFile={{identity_path}}"

and I get just simple message on client

read: Connection reset by peer

and simple message on server

"Connection reset by peer"

Q what I can do next?

Best Answer

There can be many mistakes in syntax, and many more in connection.

Best solution is turn on verbose mode with switch

-o debug

and in my case I see problem with "absolute path to identity file"

no such identity: {{identity_file}}: No such file or directory
Permission denied (publickey).
read: Connection reset by peer

so my full command looks like this

sshfs {{user_name}}@{{server_ip}}:/ /mnt/{{server_ip}} -o "IdentityFile={{absolute_path}},port={{port_number}}" -o debug
Related Question