请教个的 ssh 连接不上的问题, SSH2_MSG_KEXINIT sent 后马上关闭了 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
BeforeTooLate
V2EX    SSH

请教个的 ssh 连接不上的问题, SSH2_MSG_KEXINIT sent 后马上关闭了

  •  
  •   BeforeTooLate 2023-11-13 16:26:03 +08:00 1301 次点击
    这是一个创建于 762 天前的主题,其中的信息可能已经有所发展或是发生改变。

    服务器环境:Debian 12 ssh:OpenSSH_9.2p1 Debian-2+deb12u1, OpenSSL 3.0.11 19 Se 2023

    1.本地终端如 Microsoft terminal 可以正常 ssh 连接
    2.同步对比软件 beyond compare 无法连接此服务器,但是可以正常连接其他老的 centos 服务器
    3.还是怀疑是我 beyond compare 版本太老了,下了最新的 beyond compare4 ,可以正常连接
    4.sshd 我开启了密码和密钥都可以认证,为啥 beyond compare3 还是不能连接,我就开启了日志 debug 模式,看看发生什么问题,发现在 SSH2_MSG_KEXINIT sent 后就直接关闭了,下面是日志,而本地客户端是看不到日志的,我查了下有说让我重新生成一下 ssh_host*,有的说 mtu 设置不对。试了都不行。
    2023-11-13T15:50:26.806667+08:00 xxxxx sshd[222683]: debug1: Forked child 222693.
    2023-11-13T15:50:26.807145+08:00 xxxxx sshd[222693]: debug1: Set /proc/self/oom_score_adj to 0
    2023-11-13T15:50:26.807247+08:00 xxxxx sshd[222693]: debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7
    2023-11-13T15:50:26.816725+08:00 xxxxx sshd[222693]: debug1: inetd sockets after dupping: 4, 4
    2023-11-13T15:50:26.816825+08:00 xxxxx sshd[222693]: Connection from 1.1.1.1 port 62336 on 2.1.1.1 port 10011 rdomain ""
    2023-11-13T15:50:26.816891+08:00 xxxxx sshd[222693]: debug1: Local version string SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u1
    2023-11-13T15:50:26.824087+08:00 xxxxx sshd[222693]: debug1: Remote protocol version 2.0, remote software version Beyond
    2023-11-13T15:50:26.824194+08:00 xxxxx sshd[222693]: debug1: compat_banner: no match: Beyond
    2023-11-13T15:50:26.825178+08:00 xxxxx sshd[222693]: debug1: permanently_set_uid: 101/65534 [preauth]
    2023-11-13T15:50:26.825337+08:00 xxxxx sshd[222693]: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
    2023-11-13T15:50:26.825398+08:00 xxxxx sshd[222693]: debug1: SSH2_MSG_KEXINIT sent [preauth]
    2023-11-13T15:50:26.833071+08:00 xxxxx sshd[222693]: Connection closed by 1.1.1.1 port 62336 [preauth]
    2023-11-13T15:50:26.833245+08:00 xxxxx sshd[222693]: debug1: do_cleanup [preauth]
    2023-11-13T15:50:26.833372+08:00 xxxxx sshd[222693]: debug1: monitor_read_log: child log fd closed
    2023-11-13T15:50:26.833414+08:00 xxxxx sshd[222693]: debug1: do_cleanup
    2023-11-13T15:50:26.833454+08:00 xxxxx sshd[222693]: debug1: Killing privsep child 222694
    2023-11-13T15:50:26.833487+08:00 xxxxx sshd[222693]: debug1: audit_event: unhandled event 12

    2 条回复    2023-11-13 16:41:08 +08:00
    tool2d
        1
    tool2d  
       2023-11-13 16:37:31 +08:00   1
    感觉像是 openssh 不支持客户端的老算法,可以手动加上 beyond compare3 支持的老算法,比如

    echo "HostkeyAlgorithms ssh-dss,ssh-rsa" >> sshd_config
    echo "KexAlgorithms +diffie-hellman-group1-sha1" >> sshd_config

    之类的,再重启 sshd 就可以了。
    BeforeTooLate
        2
    BeforeTooLate  
    OP
       2023-11-13 16:41:08 +08:00
    @tool2d 万分感谢,真的是这个问题。
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3310 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 04:48 PVG 12:48 LAX 20:48 JFK 23:48
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86