darkoperator / Posh-SSH

PowerShell Module for automating tasks on remote systems using SSH
BSD 3-Clause "New" or "Revised" License
968 stars 225 forks source link

Add Support SHA256 fingerprints for host key validation #565

Open MVKozlov opened 4 months ago

MVKozlov commented 4 months ago

I think we need it because it's default for original ssh

https://github.com/sshnet/SSH.NET/pull/1098

darkoperator commented 4 months ago

Makes sense

MVKozlov commented 4 months ago

I plan to do this in the near future, I think it’s worth making it by default, leaving the old format only for compatibility

MVKozlov commented 4 months ago

Is it necessary to force the host to be updated to the new format in hosts.json ?

MVKozlov commented 4 months ago

@darkoperator, What do you think about whether it is necessary to update the keys to the new format? I prepared commits for PR

darkoperator commented 4 months ago

You mean the current key fingerprints that are stored ? If it is those it would simplify the code by removing the backward complexity, but adds the risk of a bug causing issues. I think it would be a risk we can mitigate by testing before pushing and it should not be a problem.

MVKozlov commented 4 months ago

yes, at the moment I’m just testing first for a match with sha256, then md5. and then the result can be saved (now commented out).

For new hosts, a new format sha256 is always written.

It seems to me that this could be done after upgrade the version to 4.0 (you also have serious changes there with authorization)