Kevin Wilson
2014-Apr-01 07:05 UTC
How can I have the same ssh key for dual boot (ssh-keygen)
I use: ssh-keygen -t rsa to generate a key file (id_rsa.pub) 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 ? regards, Kevin
Damien Miller
2014-Apr-01 07:08 UTC
How can I have the same ssh key for dual boot (ssh-keygen)
On Tue, 1 Apr 2014, Kevin Wilson wrote:> I use: > ssh-keygen -t rsa > to generate a key file (id_rsa.pub) 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 ?Copy it from one to the other.
Jan de Haan
2014-Apr-01 07:11 UTC
How can I have the same ssh key for dual boot (ssh-keygen)
Hi Kevin, 2 possible solutions: 1) put the same private key (id_rsa, not id_rsa.pub) on a shared medium (usb stick comes to mind) and use that, by mounting it on ~/.ssh, or such. 2) copy the same private key to both environments. Sincerely, Jan. On Tue, Apr 1, 2014 at 9:05 AM, Kevin Wilson <wkevils at gmail.com> wrote:> I use: > ssh-keygen -t rsa > to generate a key file (id_rsa.pub) 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 ? > > regards, > Kevin > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >-- "Piracy is simply demand where supply does not exist."
Martin Hecht
2014-Apr-01 07:34 UTC
How can I have the same ssh key for dual boot (ssh-keygen)
one thing not yet mentioned by others: You should not only synchronize the keys in ~/.ssh/ but, more important, in order to avoid that all other clients complain about a suspeced man in the middle attack, you should copy the host keys located in /etc/ssh/ (e.g. by temporarily putting them on an usb medium during reboot, or by mounting the root partition of the other linux e.g. somewhere below /mnt - just once for copying the files). Then, clean up the ~/.ssh/known_hosts files on the other machines. On 04/01/2014 09:05 AM, Kevin Wilson wrote:> I use: > ssh-keygen -t rsa > to generate a key file (id_rsa.pub) 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 ? > > regards, > Kevin > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Philip Hands
2014-Apr-01 08:48 UTC
How can I have the same ssh key for dual boot (ssh-keygen)
Kevin Wilson <wkevils at gmail.com> writes:> I use: > ssh-keygen -t rsa > to generate a key file (id_rsa.pub) 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] http://www.hands.com/ |-| HANDS.COM Ltd. http://ftp.uk.debian.org/ |(| 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: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20140401/63e402d3/attachment.bin>