我正在尝试使用 SSHFS 连接两台服务器。
以 root 身份启动命令时sshfs myuser@ip_adress:/some/dir /other/dir -o idmap=user,identityfile=/home/myuser/.ssh/id_rsa
,一切正常。
/etc/fstab
但是,当我在运行中设置此 SSHFS 配置时mount -a
,它会挂起。中的行/etc/fstab
是:
myuser@ip_adress:/some/dir /other/dir fuse.sshfs defaults,_netdev,IdentityFile=/home/myuser/.ssh/id_rsa 0 0
我已经尝试了很多选择,但到目前为止,没有任何效果。
通过添加选项并运行ssh_command=ssh\040-vv,sshfs_debug,debug
,我得到以下输出:/etc/fstab
mount -av
executing <ssh> <-vvv> <-x> <-a> <-oClearAllForwardings=yes> <-oidentityfile=/home/myuser/.ssh/id_rsa> <-2> <myuser@ip_adress> <-s> <sftp>
OpenSSH_8.4p1 Debian-5, OpenSSL 1.1.1k 25 Mar 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname ip_address is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/root/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/root/.ssh/known_hosts2'
debug2: ssh_connect_direct
debug1: Connecting to ip_address [ip_address] port 22.
debug1: Connection established.
我不明白为什么 SSH 连接此时挂起。
你知道是什么问题吗?
谢谢