linux 无法与端口22协商:找不到匹配的MAC,他们提供:hmac-sha1

pjngdqdw  于 2022-11-22  发布在  Linux
关注(0)|答案(1)|浏览(731)

我一直在研究这个问题,也看了一些其他的帖子,但不知道这里发生了什么。
当我尝试通过SFTP连接到另一台服务器时,我收到一个错误,没有找到匹配的MAC。我运行了ssh -Q mac,发现hmac-sha1在那里。我还检查了/etc/ssh/sshd_config文件,发现没有MAC参数。我还可以检查什么来查看导致此问题的原因?
SSH -vvv到目标服务器

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to [] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version CrushFTPSSHD
debug1: no match: CrushFTPSSHD
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to as 'root'
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha2-512,hmac-sha2-256
debug2: MACs stoc: hmac-sha2-512,hmac-sha2-256
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha1,ext-info-s
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,ssh-dss,rsa-sha2-256
debug2: ciphers ctos: aes256-ctr,aes128-ctr,aes128-cbc,3des-cbc,blowfish-cbc
debug2: ciphers stoc: aes256-ctr,aes128-ctr,aes128-cbc,3des-cbc,blowfish-cbc
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1
debug2: compression ctos: none,zlib
debug2: compression stoc: none,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: rsa-sha2-512
Unable to negotiate with  port 22: no matching MAC found. Their offer: hmac-sha1```

ssh -Q mac             
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
hmac-ripemd160
hmac-ripemd160@openssh.com
umac-64@openssh.com
umac-128@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-sha2-512-etm@openssh.com
hmac-md5-etm@openssh.com
hmac-md5-96-etm@openssh.com
hmac-ripemd160-etm@openssh.com
umac-64-etm@openssh.com
umac-128-etm@openssh.com
lyfkaqu1

lyfkaqu11#

错误 * 我正在获取 *
请admin@192.168.122.41

  • 无法与192.168.122.41端口22协商:未找到匹配的MAC。他们的报价:请访问:hmac-sha2-256-etm@openssh.com、hmac-sha2-512-etm@openssh.com、hmac-sha 2 -256、hmac-sha 2 -512*

解决方案Ubuntu 22用户...请注意,当您登录到ssh标准较低的设备(如思科路由器IOS 17.3.6)时,这与客户端功能问题有关..
解决方案-简单地做
/etc/ssh/ssh配置文件
取消注解上述ssh_config文件底部附近的1-2个参数(“或”简单地将以下内容粘贴到文件底部,而不取消注解任何内容)。
加密算法aes128-ctr、aes192-ctr、aes256-ctr、aes128-cbc、3des-cbc MAC、hmac-md5、hmac-sha1、umac-64@openssh.com、www.example.com、hmac-sha2-256-etm@openssh.comhmac-sha2-512-etm@openssh.com、hmac-sha2-256、hmac-sha2-512
如果问题仍然存在,请检查在执行ssh时从远程设备收到的报价是什么。
是关于密码吗?还是关于钥匙?
只需取消注解所需的param(cipher或mac),并添加所需的后缀(由远程设备。希望这有帮助

相关问题