使用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'