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
hostkeys clobbers known_hosts entries that have unknown keytypes #435
Thus, when the file is saved out, those entries get scrubbed.
In ParamikoJS's case I don't support ECDSA just yet so those get scrubbed. You can imagine the future where this will break for other keytypes for Paramiko as well.
(Had no idea ParamikoJS was a thing, that's interesting :))
I feel like I've seen this or a related issue before (re: loading, incorrectly mutating, then re-writing known_hosts files) but I can't find it in a quick search.
The correct fix for this feels like it needs to preserve enough info that it can just write the data back out w/o losing it, but also not violate any assumptions the rest of the code is making about the contents of the HostKeys object.
With luck this just means adding an attribute or two to HostKey (for the write side - right now I believe we rely on stringification of the resultant PKey objects) and tweaking either HostKeys or the other accesses to it, depending on what might blow up when handed a HostKey which doesn't have a valid PKey-subclass .key attribute.
I don't have time to attack this right now (and it might be considered part of #387 kinda) but would consider a PR from somebody.
Activity
bitprophet commentedon Nov 12, 2014
Thanks for the report!
(Had no idea ParamikoJS was a thing, that's interesting :))
I feel like I've seen this or a related issue before (re: loading, incorrectly mutating, then re-writing known_hosts files) but I can't find it in a quick search.
The correct fix for this feels like it needs to preserve enough info that it can just write the data back out w/o losing it, but also not violate any assumptions the rest of the code is making about the contents of the
HostKeysobject.With luck this just means adding an attribute or two to
HostKey(for the write side - right now I believe we rely on stringification of the resultantPKeyobjects) and tweaking eitherHostKeysor the other accesses to it, depending on what might blow up when handed aHostKeywhich doesn't have a validPKey-subclass.keyattribute.I don't have time to attack this right now (and it might be considered part of #387 kinda) but would consider a PR from somebody.
mimecuvalo commentedon Jan 15, 2015
Sorry to not respond earlier. This was the patch on the ParamikoJS side fwiw (was linked to from the issue up above): mimecuvalo/paramikojs@7bbe853
The solution was to create an UnknownKey class - perhaps that'll make for a similar solution on the python end of things.
sirkubax commentedon Dec 14, 2017
https://stackoverflow.com/questions/47636165/az-acs-kubernetes-get-credentials-invalid-ec-key-ssh-known-hosts-corrupted