Is it possible to seed ssh-keygen
with a fixed string so that it consistently generates the same keypair?
-
5Why do you want to do this? Can't you copy the key files instead?– SvenJun 14, 2012 at 8:56
-
1@SvenW I can, and I am, but this would be an alternative for when there is no central repository to store the keys.– Bart van HeukelomJun 14, 2012 at 11:22
-
3And why is this downvoted? I can understand if one does not agree with this method, but this is not a bad question?– Bart van HeukelomJun 14, 2012 at 11:22
-
1@BartvanHeukelom if you lack a central repository to store the keys then you also lack a central repostory to store the seeds, no?– CeladaJun 14, 2012 at 12:42
-
4This is a valid question. The seeds could be generated from a condition, like a hostname or MAC address. If the public key has been put in authorized_keys on other servers, if the machine is rebuilt for any reason, the key can be regenerated from the hostname (without keys having to be stored somewhere), and it will retain access to those other servers. I'd also be interested in an answer to how this may be done.– Anthony RoyDec 6, 2012 at 9:57
|
Show 2 more comments
3 Answers
No. You can pick certain criteria which may reduce the randomness of the generated key, but the generation process is not a simple as picking a particular seed from which the keys are generated.
Here is another cool tool for generating deterministic ssh keys: cornfeedhobo/ssh-keydgen, it's written on go