LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   How to know/find out/see my ssh host key (https://www.linuxquestions.org/questions/red-hat-31/how-to-know-find-out-see-my-ssh-host-key-609114/)

khaos83 12-25-2007 10:13 PM

How to know/find out/see my ssh host key
 
A quick qns, how do i find out or see or know my host key?



I am using putty on a windows and managed to log in to my linux although it screamed for the unknow host key as usual for 1st time log-in. I know nothing will go wrong so I just accepted it.

I just installed my linux and didnt do anything to my ssh keys.
They may be default keys.


It should look like 7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a.
I believe it should be located at /etc/ssh/ in ssh_host key files but I do not know how to view it.

Thanks in advance.

shadowsnipes 12-25-2007 10:40 PM

as root simply cat the file.
For instance...
Code:

cat /etc/ssh/ssh_host_rsa_key.pub
The public keys are the ones that will show up in the known_hosts file. cat the other public keys to check them out as well...

khaos83 12-25-2007 11:22 PM

i can see these .pub file in /etc/ssh

ssh_host_dsa_key.pub
ssh_host_key.pub
ssh_host_rsa_key.pub

I, cat ssh_host_dsa_key.pub, get, e.g.
AAAB3NzaSLDHLHKASDG82JKASDH:KLAJSDH/alskfHASLl2lhl12h4kjlhASLDH and so on

cat ssh_host_key.pub, get e.g.
1024 35 321657432435731387354 and so on

cat ssh_host_rsa_key.pub, get, e.g.
AAAAB3NzaC1lahflASLDHSLkjaskDkjaf8207SAKJcash2AKJs and so on




How can i view it in this format ? e.g.
7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a

Because i want to compare it with putty's msg.
I am not proficient with hexedecimel and binary thingy, so please forgive me for asking too much.

LinuxManMikeC 12-25-2007 11:40 PM

Quote:

Originally Posted by khaos83 (Post 3001567)
How can i view it in this format ? e.g.
7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a

Actually, that is a public key "fingerprint", not the entire key. You can view your server's fingerprints by running the following commands:
Code:

ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub

ssh-keygen -l -f /etc/ssh/ssh_host_key.pub


khaos83 12-26-2007 03:35 AM

thanks for the help. :)

berrysoft 01-12-2019 09:05 PM

Quote:

Originally Posted by khaos83 (Post 3001567)
i can see these .pub file in /etc/ssh

ssh_host_dsa_key.pub
ssh_host_key.pub
ssh_host_rsa_key.pub

I, cat ssh_host_dsa_key.pub, get, e.g.
AAAB3NzaSLDHLHKASDG82JKASDH:KLAJSDH/alskfHASLl2lhl12h4kjlhASLDH and so on

cat ssh_host_key.pub, get e.g.
1024 35 321657432435731387354 and so on

cat ssh_host_rsa_key.pub, get, e.g.
AAAAB3NzaC1lahflASLDHSLkjaskDkjaf8207SAKJcash2AKJs and so on

How can i view it in this format ? e.g.
7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a

Because i want to compare it with putty's msg.
I am not proficient with hexedecimel and binary thingy, so please forgive me for asking too much.

Please see my YouTube.com video: https://youtu.be/794sn9nllSM

$ ssh-keyscan | ssh-keygen -lf -


All times are GMT -5. The time now is 12:44 AM.