Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

I could not connect to device after update

Open marcelo-0511 opened this issue 3 years ago • 11 comments

Hello, good evening

I could not connect in fortianalyzer device after device update to version 7.0.4, I am getting the following error on device:

SSH unable to negotiate with 192.168.10.10 port 63012: no matching host key type found. Their offer: ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss

I got the following SSH Error on machine:

image

Below there is my machine configuration:

PS U:> Get-Module posh-ssh

ModuleType Version Name ExportedCommands


Manifest 3.0.8 Posh-SSH {Get-SCPItem, Get-SFTPItem, Get-SSHHostKey, Get-SSHJsonKnownHost...}

PS U:> $PSVersionTable

Name Value


PSVersion 5.1.22000.832 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22000.832 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

I am getting the same error in another machines.

Obs. It is working fine using "Putty".

Thanks in advance.

marcelo-0511 avatar Nov 03 '22 21:11 marcelo-0511

What is the “device”? Cisco? H3C?

darkoperator avatar Nov 03 '22 22:11 darkoperator

That is a fortinet fortianalyzer.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carlos Perez @.> Sent: Thursday, November 3, 2022 7:43:50 PM To: darkoperator/Posh-SSH @.> Cc: marcelo-0511 @.>; Author @.> Subject: Re: [darkoperator/Posh-SSH] I could not connect to device after update (Issue #495)

What is the “device”? Cisco? H3C?

— Reply to this email directly, view it on GitHubhttps://github.com/darkoperator/Posh-SSH/issues/495#issuecomment-1302760895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AP7LJRMYCSXLDDBFEG4DLV3WGQ52NANCNFSM6AAAAAARWS2ND4. You are receiving this because you authored the thread.Message ID: @.***>

marcelo-0511 avatar Nov 03 '22 22:11 marcelo-0511

Any way to change the host key on it to one of the supported algorithms by the library (list is in the readme.md)? Seems it upgraded to ciphers that are not supported by the module Sent from my iPhoneOn Nov 3, 2022, at 6:45 PM, marcelo-0511 @.***> wrote: That is a fortinet fortianalyzer.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carlos Perez @.> Sent: Thursday, November 3, 2022 7:43:50 PM To: darkoperator/Posh-SSH @.> Cc: marcelo-0511 @.>; Author @.> Subject: Re: [darkoperator/Posh-SSH] I could not connect to device after update (Issue #495)

What is the “device”? Cisco? H3C?

— Reply to this email directly, view it on GitHubhttps://github.com/darkoperator/Posh-SSH/issues/495#issuecomment-1302760895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AP7LJRMYCSXLDDBFEG4DLV3WGQ52NANCNFSM6AAAAAARWS2ND4. You are receiving this because you authored the thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

darkoperator avatar Nov 03 '22 22:11 darkoperator

The host keys supported are

ssh-ed25519 ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 ssh-rsa ssh-dss

darkoperator avatar Nov 03 '22 22:11 darkoperator

maybe Posh-SSH was already connecting to the device with an RSA key, so maybe you need to remove the old device key from the Posh-SSH keystore and reconnect

MVKozlov avatar Nov 04 '22 12:11 MVKozlov

Hello, good morning, sorry for my delay.

maybe Posh-SSH was already connecting to the device with an RSA key, so maybe you need to remove the old device key from the Posh-SSH keystore and reconnect

I Tried it but without sucess.

marcelo-0511 avatar Nov 04 '22 13:11 marcelo-0511

The host keys supported are ssh-ed25519 ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 ssh-rsa ssh-dss

I am checking it with device maker, I will post the reply soon.

marcelo-0511 avatar Nov 04 '22 13:11 marcelo-0511

https://docs.fortinet.com/document/fortigate/7.0.4/administration-guide/484445/fortigate-encryption-algorithm-cipher-suites

image

marcelo-0511 avatar Nov 09 '22 21:11 marcelo-0511

It's about encryption, not host keys

You can try to use ssh-keyscan yourhostname and look at second column

MVKozlov avatar Nov 10 '22 06:11 MVKozlov

image

I will try update the device.

marcelo-0511 avatar Dec 26 '22 22:12 marcelo-0511

After some testing I think this could be a problem that Renci has with rsa-sha2-512 and rsa-sha2-256, I had to change a recent server to ECDA to get it working and there are several discussion in Renci.SSH repo on it

darkoperator avatar Apr 02 '23 20:04 darkoperator