带有标识文件的 sshfs“由对等方重置连接”

BG *_*UNO 4 linux ssh sshfs amazon-ec2

有时我需要创建服务器网络 - 链接服务器并快速复制数据。

我正在使用该SSH 文件系统 (SSHFS),因为它简单易用,就像连接Secure Shell (SSH) 一样

出于更好的安全原因,我使用身份验证文件而不是密码。另一个原因是“ Amazon Web Services (AWS) EC2 ”的默认设置。

有时我不知道连接问题出在哪里

sshfs {{user_name}}@{{server_ip}}:{{remote_path}} {{local_path}} -o "IdentityFile={{identity_path}}"
Run Code Online (Sandbox Code Playgroud)

我在客户端只收到简单的消息

read: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)

和服务器上的简单消息

"Connection reset by peer"
Run Code Online (Sandbox Code Playgroud)

问我接下来可以做什么?

BG *_*UNO 5

语法上可能有很多错误,还有更多相关的错误。

最好的解决方案是用开关打开详细模式

-o debug
Run Code Online (Sandbox Code Playgroud)

就我而言,我看到“身份文件的绝对路径”有问题

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

所以我的完整命令看起来像这样

sshfs {{user_name}}@{{server_ip}}:/ /mnt/{{server_ip}} -o "IdentityFile={{absolute_path}},port={{port_number}}" -o debug
Run Code Online (Sandbox Code Playgroud)