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

Nico Kadel-Garcia nkadel at
Wed Apr 2 21:53:27 EST 2014

On Wed, Apr 2, 2014 at 6:20 AM, Philip Hands <phil at> wrote:
> Nico Kadel-Garcia <nkadel at> writes:
>> On Tue, Apr 1, 2014 at 4:48 AM, Philip Hands <phil at> wrote:
>>> 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?
>> It's not an "additoinal" key. It's a mismatched key for the same
>> hostname in DNS and the same IP address. This causes every SSH client
>> on the planet to complain about the mismatch, unless you've
>> specifically disabled that check in your client configuration. And
>> there is *no* tool besides a text editor for updating such changed
>> records in the UNIX/Linux client text based client world besides a
>> text editor.
> The original question was about client authentication keys, not host
> keys, unless I misunderstood the bit about:
>   I use:
>   ssh-keygen -t rsa
>   to generate a key file ( ...
> Cheers, Phil.

Good point. I was thinking of the inevitable "known_hosts" conflicts
when SSH'ing *to each of the dual-boot environments. The use of
multiple public keys in authorized_hosts is much less of an issue. But
the clients for other environments are still likely to face the
mismatched host keys issue, unless the dual boot environment is
carefully managed to have distinct IP addresses for each of the
dual-boot environments.

That sort of fun and games is partly why I've moved away from dual
boot, and instead prefer to virtualize development environments on a
stable host machine. The Windows box for games, which need
performance, runs as a base OS for the play host, and the development
work happens in the VM's.

More information about the openssh-unix-dev mailing list