解决sshfs挂载报错

使用ssh命令和sshfs命令报错 read: Connection reset by peer

root@jiangcheng01:~/common/remote# sshfs -o allow_other htrd@xxx.xxx.xxx.xxx:/home/htrd /root/common/remote/dev01 read: Connection reset by peer

报错问题排查,追加命令 -o debug -o sshf s_debug

root@jiangcheng01:~/.ssh# sshfs -o allow_other htrd@xxx.xx.xxx.xx:/home/htrd /root/common/remote/dev01 -o debug -o sshf s_debug SSHFS version 2.10.0 FUSE library version: 2.9.9 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0 executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-2> <htrd@xxx.xx.xxx.xx> <-s> <sftp> Unable to negotiate with xxx.xx.xxx.xx port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss read: Connection reset by peer

发现问题 ssh-rsa,ssh-dss ,这两个算法,根据网上解决方案,具体的解决方案如下,在命令中新增HostKeyAlgorithms=+ssh-dss

sshfs -oHostKeyAlgorithms=+ssh-dss htrd@xxx.xx.xxx.xx:/home/htrd /root/common/remote/dev01

eg.取消挂载的命令

root@jiangcheng01:~# fusermount -u ~/common/remote/dev01

挂载之后可以使用 exeplorer.exe 打开挂载的文件夹,但是可能也会报错,我今天试了一下,这个命令之前是好的,但是现在不可用了,解决方案1是 加上完整的路径,具体如下所示:

root@jiangcheng01:~/common/remote# cd dev01/ root@jiangcheng01:~/common/remote/dev01# explorer.exe . explorer.exe: command not found root@jiangcheng01:~/common/remote/dev01# explorer.exe . explorer.exe: command not found root@jiangcheng01:~/common/remote/dev01# /mnt/c/windows/explorer.exe . root@jiangcheng01:~/common/remote/dev01#

解决方案2是

echo 'PATH=$PATH:/mnt/c/windows' >> ~/.bashrc

或者修改 ~/.bash_aliases

alias start='/mnt/c/windows/explorer.exe'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值