How can I have the same ssh key for dual boot (ssh-keygen)

Philip Hands phil at
Tue Apr 1 19:48:02 EST 2014

Kevin Wilson <wkevils at> writes:

> I use:
> ssh-keygen -t rsa
> to generate a key file ( which I copy into authorized_keys2 on
> other machines in order to permit ssh to these machines without being
> asked for a password.
> The thing is that I have dual boot on this machine: one for fedora and
> one for ubuntu. The two key files which were generated on these machine
> are different.
> Is there a way so that I will have the same key file for both these fedora
> and
> ubuntu ?

As mentioned by others, there is a way to do this, but I'd suggest that
you shouldn't want to.

What's wrong with having an additional key in the authorized_keys file?

If the thing you're trying to avoid is the pain of installing the keys
twice, well if you're using ssh-copy-id just add the public key for the
other machine into the id_*.pub file on each, then whichever you install
From will authorise both.  If you've got a more structured way of
installing the keys (i.e. chengine, puppet etc. etc.) then just add both
keys to your config and you're done.

This seems preferable both on the basis that you're not having to fiddle
with the host keys in possibly assumption-breaking ways, but also
because it may come to pass that one of the keys is somehow compromised
while the other remains secure, in which case you'll be able to boot the
secure system and fix things.

Cheers, Phil.
|)|  Philip Hands [+44 (0)20 8530 9560]
|-|  HANDS.COM Ltd.          
|(|  10 Onslow Gardens, South Woodford, London  E18 1NE  ENGLAND
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <>

More information about the openssh-unix-dev mailing list