You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ssh-agent: agent returned different signature type #1263
Client OperatingSystem
Windows 10 Enterprise (1709)
What is failing
I've installed the 'ssh-agent' service. I call ssh-add to add my key to the agent. I'm asked to provide my passphrase, which I do. When I use the ssh command I get warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512).
Expected output
No warning.
Actual output warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512).
Reacted by Mårten Nordheim, David Matson, David Justice, Berislav Hunjadi, Dylan Wulf, Peter Magnusson, Known Rabbit, Mythreya Kuricheti, Daniel García, Juhong Park and 57 more
The reason for this is you are giving public key to ssh-agent via ssh-add eg ssh-add FILE_NAME.pub instead of private key i.e. ssh-add FILE_NAME.
Reacted by Sandro, Athanasios Douitsis, Nikolay D Khodyunya, Cédric Belin, Eric Newland, Yusoof Moh, Yang, Mythreya Kuricheti, Changwei Miao, Gordon Tucker and 129 more
Reacted by Peter Ullrich, shanNoodle, Rangel Stoilov, Eduard Paul, Arthur Zhuk, NIkita Kruglickiy, Aaron Rubesh, Rustam Safin, XPIOKBA, amaru-one and 4 more
ssh(1): Warn when the agent returns a ssh-rsa (SHA1) signature when
a rsa-sha2-256/512 signature was requested. This condition is possible
when an old or non-OpenSSH agent is in use. bz#279
Hi,
I do not want to duplicate issues. Should I open new issue, please let me know. ssh client version: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 ssh server version: OpenSSH_7.9p1, OpenSSL 1.1.1 FIPS 11 Sep 2018
I'm also warned about different signature. Moreover, authentication with public key fails, and ssh client falls back to password authentication:
debug1: Offering public key: RSA SHA256:THSeSgCr3A5YDRNtlmgjyWn2Ik5sy2ooxtfIwMKQphU C:\\Users\\adamo/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug2: input_userauth_pk_ok: fp SHA256:THSeSgCr3A5YDRNtlmgjyWn2Ik5sy2ooxtfIwMKQphU
debug3: sign_and_send_pubkey: RSA SHA256:THSeSgCr3A5YDRNtlmgjyWn2Ik5sy2ooxtfIwMKQphU
warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512)
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Thanks. ssh-agent on Windows is using an older signing algorithm that your sever is rejecting. The issue is with ssh-agent version on Windows and there isn't any workaround unfortunately. I'll have it fixed shortly and can issue a patched version of ssh-agent if you prefer.
Reacted by Jozef Izso, mr.d, Li Song, Riaz Amlani, nizaevka, Ψray, Sedat Kapanoğlu, UnlimitedCookies, J Wylie Woodcock, Alejandro Akbal and 6 more
Reacted by Dan Michael O. Heggø, Hari, Ψray, J Wylie Woodcock and Ilya
Joe Polny (@joe-p) thank you so much for your solution! This worked for me. I really think Microsoft should update their openssh integration with windows update or at least integrate a fix within the newer versions of powershell.
I have 3 different Linux-based systems running in my home. Two of the systems worked, while the one running Ubuntu Server 20.10 presented the key mismatch error.
PS C:\Users\derek> choco info openssh
Chocolatey v0.10.15
openssh 8.0.0.1 [Approved]
Title: Win32 OpenSSH (Universal Installer) | Published: 2019-06-25
Package approved as a trusted package on Aug 23 2020 09:48:44.
Package testing status: Passing on Jun 25 2019 11:09:31.
Number of Downloads: 5251069 | Downloads for this version: 1304437
Package url
Chocolatey Package Source: https://github.com/DarwinJS/ChocoPackages/tree/master/openssh
Package Checksum: 'lak7BlzqMNK+9hFdNuFlox9Z/uQKzWjmyNaCIV7A/K6hpKbxOTX3cCk/BJXXjFl2id7Lig+8aCzd6zThRiy9KA==' (SHA512)
Tags: openssh admin
Software Site: https://github.com/PowerShell/Win32-OpenSSH
Software License: https://raw.githubusercontent.com/PowerShell/Win32-OpenSSH/L1/LICENCE
Software Source: https://github.com/PowerShell/Win32-OpenSSH
Documentation: https://github.com/PowerShell/Win32-OpenSSH/wiki
Issues: https://github.com/PowerShell/Win32-OpenSSH/issues
Summary: Open SSH tools for Windows - works in all CLIs.
Description: Open SSH tools for Windows.
From PowerShell as Administrator, install OpenSSH with the ssh-agent service:
When I run that command in Powershell I get: ERROR: The running command stopped because the preference variable ErrorActionPreference" or common parameter is set to Stop: Service ' (ssh-agent)' cannot be created due to the following error: The specified service already exists
Derek Mahar (@derekmahar)
This worked for me. I uninstalled OpenSSH on Windows 10, had to reboot, then ran your command and now I don't get the error: warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512) when key registered with ssh-agent when I ssh from Windows command prompt to my Linux server.
In my experience, (Windows 10 - 20H2 OS Build 19042.928) I didn't have to install newer OpenSSH via Chocolatey or anything. I uninstalled OpenSSH client (Start -> Apps & Features -> Other Features), restarted the system and then installed it again and it fixed the problem.
Make sure you start the OpenSSH Authentication Agent service again after you installed it for the second time.
I was having problems with the Krzysztof Śmiałek (@gronostajo) solution and VSCode, but using ECDSA instead of RSA with the default Windows OpenSSH client worked for me (I had to uninstall the client, delete the files downloaded from the repository, and reinstall the OpenSSH client to ensure I was working with the default client).
To use ECDSA simply run:
ssh-keygen -t ecdsa -b 521
ssh-add [path to id_ecdsa]
Windows updated today, which made my start menu and taskbar completely transparent (had to disable transparency effects to fix), as well as breaking ssh again. So glad I found/commented/followed this thread so I could remember what I did to fix it! Wonder if it's ever not gonna be broken 🤣
The official Windows Update 20H2 is here and the problem persists unfortunately.
If anyone is curious, Windows 20H2 (19042.928) comes with OpenSSH 7.7.2.1:
PS C:\> Get-Command ssh
CommandType Name Version Source
----------- ---- ------- ------
Application ssh.exe 7.7.2.1 C:\Windows\System32\OpenSSH\ssh.exe
This version was released in 2018. Microsoft has been saying a new release of OpenSSH will come with every single Windows update, and every single update does not have a new version. They clearly have abandoned this project. Don't install it through Windows. Stop waiting for it to be fixed.
Please refer to #1693 for news about OpenSSH V8.1.
It's part of April windows update (Cumulative Non-sec update) which is available by end of this month.
Windows 10 version 21H1 comes with OpenSSH 8.1, which has this bug fixed. The PATH modification can be reverted now, so that ssh.exe from System32 is the default one (check where ssh output).
The upgrade to 21H1 disables the agent service though. It must be re-enabled in services.msc.
Reacted by Dylan Wulf, Allan Oricil, towzeur, Alexandre Gauthier and Sandro
Reacted by Dylan Wulf and ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Under Windows 10.8 LTS Arium ([version 10.0.19044.3086), I fixed the problem with the installation of :
https://github.com/PowerShell/Win32-OpenSSH
Activity
manojampalam commentedon Oct 9, 2018
Can you detail how the keys were generated in the first place?
Morten242 commentedon Oct 9, 2018
In my case I generated it using ssh-keygen from System32/OpenSSH (don't remember but I don't think I had any extra arguments).
stevehipwell commentedon Oct 9, 2018
I also generated mine with
ssh-keygenwithout arguments.manojampalam commentedon Oct 9, 2018
Got it. Investigating.
the1derer commentedon Nov 13, 2018
The reason for this is you are giving public key to ssh-agent via
ssh-addegssh-add FILE_NAME.pubinstead of private key i.e.ssh-add FILE_NAME.stevehipwell commentedon Nov 14, 2018
Shubham Raj (@the1derer) if you're replying to the original issue please see that the command used was
ssh-addwithout any arguments.davidmatson commentedon Nov 20, 2018
For a discussion of this symptom in another product see:
cuviper/ssh-pageant#55
Especially:
admo commentedon Dec 16, 2018
Hi,
I do not want to duplicate issues. Should I open new issue, please let me know.
ssh client version: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
ssh server version: OpenSSH_7.9p1, OpenSSL 1.1.1 FIPS 11 Sep 2018
I'm also warned about different signature. Moreover, authentication with public key fails, and ssh client falls back to password authentication:
Log from server:
However, if I remove keys from ssh-agent and ssh uses keys from
%USERPROFILE%\.ssh, then authentication succeed:Is it a bug? Are you aware of it? Is there any workaround for it?
manojampalam commentedon Dec 17, 2018
Adam Oleksy (@admo) what's your server OS & OpenSSH version ?
admo commentedon Dec 17, 2018
Manoj Ampalam (@manojampalam) OpenSSH_7.9p1, OpenSSL 1.1.1 FIPS 11 Sep 2018
manojampalam commentedon Dec 17, 2018
Thanks. ssh-agent on Windows is using an older signing algorithm that your sever is rejecting. The issue is with ssh-agent version on Windows and there isn't any workaround unfortunately. I'll have it fixed shortly and can issue a patched version of ssh-agent if you prefer.
admo commentedon Dec 17, 2018
Manoj Ampalam (@manojampalam) understood. Could I somehow deploy patched version on my host?
82 remaining items
shyney7 commentedon Feb 19, 2021
Joe Polny (@joe-p) thank you so much for your solution! This worked for me. I really think Microsoft should update their openssh integration with windows update or at least integrate a fix within the newer versions of powershell.
crl0wryjr commentedon Feb 24, 2021
I have 3 different Linux-based systems running in my home. Two of the systems worked, while the one running Ubuntu Server 20.10 presented the key mismatch error.
Following the advice from above, I:
--- sudo` scoop install -g win32-openssh
--- sudo C:\ProgramData\scoop\apps\win32-openssh\current\install-sshd.ps1
---sudo Set-Service -Name ssh-agent -StartupType Automatic
---sudo Start-Service ssh-agent`
Afterwards ssh'ing to all 3 systems worked correctly.
Total time: ~15 minutes
derekmahar commentedon Mar 14, 2021
Chocolatey provides OpenSSH 8.0.0.1:
From PowerShell as Administrator, install OpenSSH with the ssh-agent service:
FlexMcMurphy commentedon Mar 21, 2021
Derek Mahar (@derekmahar)
When I run that command in Powershell I get:
ERROR: The running command stopped because the preference variable ErrorActionPreference" or common parameter is set to Stop: Service ' (ssh-agent)' cannot be created due to the following error: The specified service already existsDo I need to uninstall ssh-agent first?
derekmahar commentedon Mar 21, 2021
FlexMcMurphy I'd guess that you'd have to remove all instances of the OpenSSH client, in particular the optional one in Windows.
FlexMcMurphy commentedon Mar 21, 2021
Derek Mahar (@derekmahar)
This worked for me. I uninstalled OpenSSH on Windows 10, had to reboot, then ran your command and now I don't get the error:
warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512) when key registered with ssh-agentwhen I ssh from Windows command prompt to my Linux server.Cheers.
mohsentaleb commentedon Apr 21, 2021
In my experience, (Windows 10 - 20H2 OS Build 19042.928) I didn't have to install newer OpenSSH via Chocolatey or anything. I uninstalled OpenSSH client (Start -> Apps & Features -> Other Features), restarted the system and then installed it again and it fixed the problem.
Make sure you start the
OpenSSH Authentication Agentservice again after you installed it for the second time.hmmmk commentedon Apr 22, 2021
genius
electr0sheep commentedon Apr 22, 2021
Windows updated today, which made my start menu and taskbar completely transparent (had to disable transparency effects to fix), as well as breaking ssh again. So glad I found/commented/followed this thread so I could remember what I did to fix it! Wonder if it's ever not gonna be broken 🤣
altano commentedon Apr 23, 2021
If anyone is curious, Windows 20H2 (19042.928) comes with OpenSSH 7.7.2.1:
This version was released in 2018. Microsoft has been saying a new release of OpenSSH will come with every single Windows update, and every single update does not have a new version. They clearly have abandoned this project. Don't install it through Windows. Stop waiting for it to be fixed.
bagajjal commentedon Apr 23, 2021
Please refer to #1693 for news about OpenSSH V8.1.
It's part of April windows update (Cumulative Non-sec update) which is available by end of this month.
gronostajo commentedon Jun 2, 2021
Windows 10 version 21H1 comes with OpenSSH 8.1, which has this bug fixed. The PATH modification can be reverted now, so that
ssh.exefromSystem32is the default one (checkwhere sshoutput).The upgrade to 21H1 disables the agent service though. It must be re-enabled in
services.msc.djipih commentedon Jun 26, 2023
Under Windows 10.8 LTS Arium ([version 10.0.19044.3086), I fixed the problem with the installation of :
https://github.com/PowerShell/Win32-OpenSSH
SheepDomination commentedon Jul 28, 2024
Is there any workaround for Windows 10.0.18363 N/A Build 18363 ?
Fixes to ssh-agent issues