当前位置: 首页 > news >正文

做网站卖高仿推荐一下网站谢谢

做网站卖高仿,推荐一下网站谢谢,徐州模板自助建站,一站式网站建设方案问题描述 客户在windows CMD中SSH连接失败,报错: Corrupted MAC on input ssh_dispatch_run_fatal: Connection to x.x.x.x port 22: message authentication code incorrect值得注意的是,客户通过别的机器做SSH连接可以成功,使用putty, mo…

问题描述

客户在windows CMD中SSH连接失败,报错:

Corrupted MAC on input
ssh_dispatch_run_fatal: Connection to x.x.x.x port 22: message authentication code incorrect

值得注意的是,客户通过别的机器做SSH连接可以成功,使用putty, mobaxterm连接也可以成功

原因分析

通过别的机器能做SSH连接,说明SSH服务端本身没有问题,网络连接也正常。
这个原因一般是SSH客户端和服务器的配置不匹配,使用了不同的MAC(消息认证码)或cipher(加密算法),导致协商失败。

定位思路

分别查看SSH客户端和服务端支持的MAC和cipher列表,先确认配置是否匹配。

查看SSH客户端支持的MAC和cipher的方法如下:

ssh -Q mac
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
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
umac-64-etm@openssh.com
umac-128-etm@openssh.comssh -Q cipher
3des-cbc
aes128-cbc
aes192-cbc
aes256-cbc
aes128-ctr
aes192-ctr
aes256-ctr
aes128-gcm@openssh.com
aes256-gcm@openssh.com
chacha20-poly1305@openssh.com

再查看SSH服务端支持的MAC和cipher,有两种方法(无需登录服务端后台)

方法1: 客户端使用nmap测试

# nmap --script ssh2-enum-algos -sV -p 22 10.206.216.97Starting Nmap 6.40 ( http://nmap.org ) at 2024-12-09 22:00 EST
Nmap scan report for 10.206.216.97
Host is up (0.00035s latency).
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.7 (protocol 2.0)
| ssh2-enum-algos:
|   kex_algorithms (10)
|       curve25519-sha256
|       curve25519-sha256@libssh.org
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group14-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|       kex-strict-s-v00@openssh.com
|   server_host_key_algorithms (4)
|       rsa-sha2-512
|       rsa-sha2-256
|       ecdsa-sha2-nistp256
|       ssh-ed25519
|   encryption_algorithms (4)
|       aes256-gcm@openssh.com
|       aes256-ctr
|       aes128-gcm@openssh.com
|       aes128-ctr
|   mac_algorithms (6)
|       hmac-sha2-256-etm@openssh.com
|       umac-128-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha2-256
|       umac-128@openssh.com
|       hmac-sha2-512
|   compression_algorithms (2)
|       none
|_      zlib@openssh.com
MAC Address: 00:0C:29:8F:61:C4 (VMware)

重点关注MAC和cipher, 是否和客户端支持的匹配:

  • encryption_algorithms(加密算法): 加密算法用于加密通信双方之间的数据,确保数据的机密性。这些算法可以是对称的(使用相同的密钥加密和解密)或非对称的(使用公钥加密,私钥解密)。SSH中常用的对称加密算法包括aes128-ctr、aes256-ctr等。
  • mac_algorithms(消息认证码算法): 消息认证码(MAC)算法用于确保数据的完整性和真实性,即确保数据在传输过程中没有被篡改,并且确实来自声称的发送者。这些算法通常与加密算法一起使用,为加密的数据提供额外的保护层。常见的MAC算法包括hmac-sha2-256、hmac-sha1等。

其他算法说明:

  • kex_algorithms(密钥交换算法): 密钥交换算法用于在客户端和服务器之间安全地交换加密密钥。这是建立安全会话的第一步,确保后续通信的机密性和完整性。常见的密钥交换算法包括diffie-hellman-group14-sha256、diffie-hellman-group-exchange-sha256等。
  • server_host_key_algorithms(服务器主机密钥算法): 服务器主机密钥算法用于服务器身份验证。服务器使用这些算法生成公钥和私钥对,公钥公开给客户端,私钥用于签名消息以证明服务器的身份。常见的服务器主机密钥算法包括ssh-rsa、ecdsa-sha2-nistp256等。
  • compression_algorithms(压缩算法): 压缩算法用于减少传输数据的大小,从而加快数据传输速度并减少带宽使用。虽然压缩可以提高性能,但它也可能增加CPU的使用率。SSH中常用的压缩算法包括none(不压缩)、zlib等。

方法2: 客户端使用ssh -vv, 再根据输出查看MAC和cipher的协商过程

ssh -vv root@10.206.216.97OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug2: resolve_canonicalize: hostname 10.206.216.97 is address
debug1: Connecting to 10.206.216.97 [10.206.216.97] port 22.
......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-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512
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 proposaldebug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,kex-strict-s-v00@openssh.com
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: aes256-gcm@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr
debug2: ciphers stoc: aes256-gcm@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr
debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,umac-128@openssh.com,hmac-sha2-512
debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,umac-128@openssh.com,hmac-sha2-512
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:kQPh28MT+40A8EpxJOcmt+lHMS5QlF1YN/lv05KM+Yg
...

解决方法

在客户端做ssh连接时, 手动指定服务端支持的MAC或cipher,例如:

ssh -m hmac-sha2-512 -c aes128-ctr root@10.206.216.97 # -m指定MAC, -c指定cipher

或者修改服务端配置,添加任一个客户端支持的MAC或cipher。在Rocky Linux 9上,可以修改配置文件/etc/crypto-policies/back-ends/opensshserver.config

参考

【1】SSH技术白皮书

http://www.yayakq.cn/news/290070/

相关文章:

  • 福建省品牌建设促进会网站自己做的网站加载不出验证码
  • 上海网站排名公司重庆装修公司口碑最好的是哪家
  • 闵行网站设计自动发布 wordpress
  • 前沿科技帮客户做的网站有钱赚吗wordpress换域名搬家图片不显示
  • 美橙建站怎么样建设银行网站注销
  • 企业网站建设该入啥会计科目织梦网站被黑
  • 每年网站备案抽查川畅咨询 的网络营销怎么做
  • 农产品网站如何做地推资讯门户类网站模板
  • 在环评备案网站上做登记后会怎么样6wordpress 静态缓存
  • 电商做网站什么意思美化网页制作教程
  • 好的淘客网站无线网被附近多个
  • 网站开发遇到的难点做个爬架网站如何做
  • 免费发广告的网站大全青州网站搭建
  • 徐州手机网站建设网站扩容需要多少钱
  • 综合信息网站模板网站一般都是用什么软件做的
  • 网站建设后期出现的问题wordpress 中文伪静态
  • 网站如何做流动字幕原网站备案在哪
  • 华为云网站备案流程奥运会网页设计欣赏
  • 物理学可建设网站建设说明无货源一键铺货软件
  • 微网站技术wordpress实现网站的登陆功能
  • 直接登录的网站注册品牌商标流程及费用
  • 建立网站基本步骤旅行社营业部管理办法
  • 建设网站答题赚钱织梦dedeeims网站打不开
  • 外贸网站建设定制建设通查询中标
  • php做在线直播网站甘肃建设投资集团控股有限网站
  • 网站建设需求文档模板wordpress 做商城
  • 网站制作视频课程如何建设网站24小时接单
  • 做网站 前台和后台centos6.8 wordpress
  • 破解软件网站吉安知名网站建设
  • vue做的博客网站网络组建与配置 2018版清华大学出版社