hallo und guten Morgen
gibt es ein putty-keygen - tool in linux?
Hintergrund: ich will gerne Keys vergleichen - das allerdings klappt mit den Methoden die ich unten zitiere nicht 100 %.
How to check if an RSA public / private key pair match
https://serverfault.com/questions/4263…-key-pair-match
I have two files, id_rsa and id_rsa.pub. What command can be used to validate if they are a valid pair?
would prefer the ssh-keygen -y -e -f <private key> way instead of the accepted answer of How do you test a public/private DSA keypair? on Stack Overflow.
ssh-keygen -y -e -f <private key> takes a private key and prints the corresponding public key which can be directly compared to your available public keys. (Hint: beware of comments or key-options.) (How the hell is it doing that? I can only hope the public key is encoded directly or indirectly in the private key...)
I needed this myself and used the following Bash one-liner.
It should output nothing if the keys belong together.
Apply a little -q to the diff in scripts and diff only sets the return code appropriately.
PRIVKEY=id_rsa
TESTKEY=id_rsa.pub
der Bash onleliner liefert bei mir ein leeres ergebnis.