11

Is it possible to seed ssh-keygen with a fixed string so that it consistently generates the same keypair?

7
  • 5
    Why do you want to do this? Can't you copy the key files instead?
    – Sven
    Jun 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. Jun 14, 2012 at 11:22
  • 3
    And why is this downvoted? I can understand if one does not agree with this method, but this is not a bad question? Jun 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?
    – Celada
    Jun 14, 2012 at 12:42
  • 4
    This 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. Dec 6, 2012 at 9:57

3 Answers 3

4

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.

0

You can, just not with the default ssh-keygen. I personally use ssh-key-generator

0

Here is another cool tool for generating deterministic ssh keys: cornfeedhobo/ssh-keydgen, it's written on go

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .