直到今天早上,我都能顺利地使用 sshfs 从办公室的 Linux 机器上挂载目录。今天,它停止了。这是我的 sshfs 命令:
sshfs -osshfs_sync,volname=linux-builder3 linux-builder3:/home/cnorum /Users/carl/linux-builder3
我收到此错误,但是 sshfs 进程似乎仍在运行(也就是说,它只是停在那里,从不返回到 shell 提示符):
mount_osxfusefs: failed to mount /Users/carl/linux-builder3@/dev/osxfuse1: Socket is not connected
Mac 上的系统日志有这些消息:
2/20/13 12:57:27.476 PM KernelEventAgent[43]: tid 00000000 received event(s) VQ_DEAD (32)
2/20/13 12:57:27.000 PM kernel[0]: OSXFUSE: force ejecting (no response from user space 5)
2/20/13 12:57:27.000 PM kernel[0]: OSXFUSE: user-space initialization failed (57)
/var/log/auth.log
Linux 机器上的情况如下:
Feb 20 12:56:28 linux-builder3 adclient[1599]: INFO <fd:22 PAMIsUserAllowedAccess> audit User 'cnorum' is authorized
Feb 20 12:56:28 linux-builder3 sshd[29648]: Accepted publickey for cnorum from 10.0.40.65 port 49850 ssh2
Feb 20 12:56:28 linux-builder3 sshd[29648]: pam_unix(sshd:session): session opened for user cnorum by (uid=0)
Feb 20 12:56:28 linux-builder3 sshd[29729]: subsystem request for sftp
与其他机器(我的情况是 linux-builder 和 linux-builder2)的 sshfs 连接似乎没问题。有人能告诉我哪里出了问题以及我应该如何修复吗?我可以获取您可能想要查看的任何日志!
答案1
对于未来的谷歌用户,我收到了这个神秘的错误,并意识到我提供给 sshfs 的路径不存在。哎呀。修复它,我走了。
mount_osxfusefs: failed to mount /Volumes/mypath@/dev/osxfuse0: Socket is not connected
答案2
.bashrc
我认为它已经修复。我在Linux 机器上有以下行:
CLIENT_PATH_PREFIX="$(ssh ${CLIENT_ADDR} 'echo ${SSHFS_PATH_PREFIX}')/$(hostname)/$(whoami)"
它不需要由非交互式 shell 运行,所以我把它推到了另一个文件中,现在好多了。我真的不明白为什么,但我很高兴它能起作用。
答案3
我的问题是主机的 RSA 主机密钥发生了变化,所以我必须运行
ssh-keygen -R site.com
答案4
对我来说,问题在于输入了一个有问题的键known_hosts
:
当我尝试通过 SSH 连接到服务器时,收到:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:<something>
Please contact your system administrator.
Add correct host key in /Users/myuser/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/myuser/.ssh/known_hosts:86
RSA host key for <server> has changed and you have requested strict checking.
Host key verification failed.
删除有问题的密钥(假设您信任该服务器),就可以解决问题。