LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   [Solved]Creating same SSH keys on different distros but same machine (https://www.linuxquestions.org/questions/linux-networking-3/%5Bsolved%5Dcreating-same-ssh-keys-on-different-distros-but-same-machine-789779/)

milomak 02-17-2010 01:42 PM

[Solved]Creating same SSH keys on different distros but same machine
 
On my desktop I run a number of distros. I often ssh into the machine. However depending on which distro I am using, the RSA key is different.

So what I will do is delete ~/.ssh/known_hosts on the machine I am using and ssh in.

what i was wondering is whether using ssh-keygen and creating the same passphrase for the distros would remove this problem?

acid_kewpie 02-17-2010 03:18 PM

you're free to copy the keys between machines / distros as much as you want. no need to recreate them

tredegar 02-17-2010 03:35 PM

So far as ssh is concerned, different distros = completely different computers, even if they are physically the same.

ssh is very security-conscious and when properly set up will not connect if it thinks anything could possibly be wrong (this is absolutely the correct behaviour, otherwise, why are you using the secure shell ?)

So you will have to set up the keys on the machine you ssh from, then copy them over to each different distro on your desktop, that you would like to ssh to, one at a time.

Looks like you are going to be doing a lot of rebooting between distros :(

anomie 02-17-2010 03:47 PM

Quote:

Originally Posted by milomak
On my desktop I run a number of distros. I often ssh into the machine. However depending on which distro I am using, the RSA key is different.

Just to further clarify here: you're referring to the host key for sshd.

Quote:

Originally Posted by milomak
So what I will do is delete ~/.ssh/known_hosts on the machine I am using and ssh in.

Better options:
  1. Give each distro its own IP / hostname; or
  2. copy the host keys in /etc/ssh (ssh_host_dsa_key*, ssh_host_rsa_key*) from one distro to all the others.

Quote:

Originally Posted by milomak
what i was wondering is whether using ssh-keygen and creating the same passphrase for the distros would remove this problem?

Nope.

milomak 02-18-2010 10:51 AM

Thanks guys. I went with anomie's option 2.


All times are GMT -5. The time now is 01:00 PM.