我正在尝试用SSHFS连接两个服务器。
作为根用户,在启动命令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连接在这一点上挂起。
你知道有什么问题吗?
谢谢
发布于 2021-06-10 08:02:29
因此,我发现了一个问题:我试图挂载.ssh文件夹(它有键连接到远程服务器)。
我不知道它为什么要在命令行上工作,而不是通过fstab (可能与SSH代理有关),但是将用于连接到SSHFS的文件夹挂载会引起问题。我把SSH键移到另一个目录,然后它就像一种魅力一样工作。
https://stackoverflow.com/questions/66880366
复制相似问题