大网数据广告活动
服务器运维问答

ssh on windows - Corrupted MAC on input

· 52CE 我爱测

I've installed OpenSSH on Windows. I can successfully connect to my remote server via ssh with Putty from this Windows machine. But when opening a PowerShell, and trying ssh [email omitted] I've got the error: debug3: send packet…

问题原文

原帖链接 · Raoul Debaze · CC BY-SA 4.0

I've installed OpenSSH on Windows.

I can successfully connect to my remote server via ssh with Putty from this Windows machine.

But when opening a PowerShell, and trying

ssh [email omitted]

I've got the error:

debug3: send packet: type 5                                                                    
Corrupted MAC on input.                                                                        
ssh_dispatch_run_fatal: Connection to 1.2.3.4 port 22: message authentication code incorrect

When looking on my remote server in the secure logs, I've got:

Dec  7 03:20:22 allo-01 sshd[10102]: Connection from 4.3.2.1 port 49869 on 1.2.3.4 port 22
Dec  7 03:20:23 allo-01 sshd[10102]: Connection reset by 4.3.2.1 port 49869 [preauth]

Do you know what's wrong? Why my ssh command from openssl on windows behave differently from PuTTY?

社区高分解答

原帖链接 · Jake · CC BY-SA 4.0

Raoul's answer to his own question is correct. I ran into the same issue and adding the correct algorithm name after the -m option works (in my case the option was -m hmac-sha2-512 to connect from PowerShell to a machine running Ubuntu 18.04).

I wasn't sure which algorithm to use, but you can list all the available ones by running:

ssh -Q mac

I selected one at random, tried it and the remote server returned saying that algorithm wasn't supported, but it handily told me which one's were so that I could amend my command. Using this command I could then ssh into the remote machine:

ssh -m hmac-sha2-512 <user_name>@<remote_address>

If you need to use scp too, the parameter is different:

scp -o MACs=hmac-sha2-512 <and the rest of your scp command>

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-12-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。