3

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?

4

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
  • -o debug is very helpful to me to find errors. – Ankur Loriya Jan 24 at 7:44
2

It's probably a timeout problem. Such a message ("read: Connection reset by peer") indicates that the connection was successful (the ssh command is OK) but ended abruptly: ssh client sent something and in return, it received a RST TCP frame which means "don't send anything, the channel is closed".

This is mainly due to a firewall disconnecting you for inactivity (but this may have other causes, like too much connections in a small timespan; firewalls are touchy these days).

To avoid timeout problems, use the ssh options TCPKeepAlive or ServerAliveInterval/ServerAliveCountMax. See this question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.