阅读:使用 sshfs 连接到 AWS 的对等方重置连接

Ann*_*nna 2 linux ssh sshfs amazon-web-services ubuntu-16.04

我正在尝试使用 sshfs 在来自 Ubuntu 16.04 的 AWS 实例上挂载目录。

我正在使用的命令:

sshfs -o IdentityFile=keyfile.pem ec2-user@ecX-X-X-X.us-west-1.compute.amazonaws.com:/var/www sshfs/
Run Code Online (Sandbox Code Playgroud)

结果(使用 -o sshfs_debug)

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

/var/log/secure 尝试连接后 AWS 实例上的条目:

May 10 00:00:33 ip-X-X-X-X sshd[19114]: Connection closed by X.X.X.X [preauth]
Run Code Online (Sandbox Code Playgroud)

我使用我个人运行的不同 VPS 进行了测试,我能够很好地使用 sshfs,并且我在此服务器中定期使用 ssh 没有任何问题。

该实例是使用创建的 amzn-ami-hvm-2015.09.0.x86_64-gp2 (ami-cd3aff89)

Ann*_*nna 5

我不得不使用一些额外的调试标志来识别问题,因为-o sshfs_debug没有解决它:

-o sshfs_debug -o debug -o LogLevel=DEBUG3
Run Code Online (Sandbox Code Playgroud)

这让我看到了非常冗长的输出,最终得到了解决问题所需的知识。IdentityFile 开关在当前目录外不起作用,因此我必须提供文件的整个路径:

sshfs -o IdentityFile=/home/anna/keyfile.pem ec2-user@ecX-X-X-X.us-west-1.compute.amazonaws.com:/var/www sshfs/
Run Code Online (Sandbox Code Playgroud)