我正在尝试在Cocoa应用程序中运行SSHFS
命令。我已经将SSHFS命令放在NSTask
中,但是在执行命令时出现了一些错误:
RSA host key for IP address 'xyz.com' not in list of known hosts.
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied (publickey,password).
remote host has disconnected
mount_osxfusefs: failed to mount /Volumes/Drive_Test@/dev/osxfuse4: Socket is not connected
在这种情况下,我认为我的应用程序无法找到ssh_askpass
。我的问题是如何运行此文件?任何建议将不胜感激。提前致谢。
ssh-askpass
是一个与MacOS不直接兼容的X11应用程序。您可以在同一路径中安装自定义ssh-askpass
,虽然它有点像黑客。 Here是一个实现,但我无法保证其完整性或安全性,或与当前MacOS的兼容性。 (另请参阅同一作者的https://jcs.org/notaweblog/2011/04/19/making_openssh_on_mac_os_x_more_secure博客,了解其他可能的方法。)
更好,更现代的解决方案是让MacOS钥匙串为您处理事情。参见例如SVN+SSH, not having to do ssh-add every time? (Mac OS)(不仅仅是SVN)。