当我跑步时
sshpass -p 'mypass' sshfs 'root'@'68.19.40.16':/ '/dir' -o StrictHostKeyChecking=no,debug
它已成功安装但在前台运行。
当我在没有“调试”参数的情况下运行时,它根本就不会安装。
服务器是ubuntu 8.04
知道原因吗?
更新:当我以 ROOT 身份运行该命令时,它确实挂载了。它不适用于其他用户。
以下是挂载失败的输出
$ sshpass -p 'pass' sshfs 'root'@'68.1.1.1':/ '/s6' -o StrictHostKeyChecking=no,sshfs_debug,loglevel=debug
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 68.1.1.1 [68.1.1.1] port 22.
debug1: Connection established.
debug1: identity file /var/www/vhosts/devrim.kodingen.com/.ssh/id_rsa type -1
debug1: identity file /var/www/vhosts/devrim.kodingen.com/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
Warning: Permanently added '68.1.1.1' (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /var/www/vhosts/devrim.kodingen.com/.ssh/id_rsa
debug1: Trying private key: /var/www/vhosts/devrim.kodingen.com/.ssh/id_dsa
debug1: Next authentication method: password
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending subsystem: sftp
Server version: 3
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: Killed by signal 1.
答案1
我发现了同样的问题:将 sshfs 与 sshpass 结合使用时,只有当 sshfs 在前台运行时(使用-f
或-d
)它才有效。如果它在后台执行,它会以退出值 0 正常执行,但不会挂载任何东西。
我发现的解决方法是在前台模式下执行 sshfs,但使用 shell 将其发送到后台:
sshpass -f passwordfile sshfs -f origin destination &
这样就可以了。然后,当您不再需要挂载并使用 fusermount -u 卸载它时,sshfs 进程将正常结束。
答案2
您需要访问保险丝设备,并且似乎需要 root 访问权限。
答案3
我们找不到这个问题的解决方案。我们正在前台运行它。
答案4
我的问题类似,与 /etc/fuse.conf 中的 fuse 配置文件有关。我必须取消注释 user_allow_other 并在没有 sudo 的情况下挂载它:sshfs -o allow_other[电子邮件保护]:/foo/bar /home/uesr/foor/bar/baz