LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 12-25-2007, 10:13 PM   #1
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Rep: Reputation: 15
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.
 
Old 12-25-2007, 10:40 PM   #2
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,441

Rep: Reputation: 70
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...
 
Old 12-25-2007, 11:22 PM   #3
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Original Poster
Rep: Reputation: 15
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.
 
Old 12-25-2007, 11:40 PM   #4
LinuxManMikeC
Member
 
Registered: Nov 2007
Location: Provo, Utah
Distribution: Debian and Ubuntu
Posts: 74

Rep: Reputation: 15
Quote:
Originally Posted by khaos83 View Post
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
 
Old 12-26-2007, 03:35 AM   #5
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Original Poster
Rep: Reputation: 15
thanks for the help.
 
  


Reply

Tags
server, sshd, sshkeygen


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open-ssh vs. commercial ssh (tru64), public-key auth not possible? cf050 Linux - Networking 8 03-28-2012 11:15 AM
ssh Host Key ziox Linux - Networking 6 02-07-2005 02:57 PM
How to setup a host.deny and host.allow for SSH? explorer1979 Linux - Security 2 01-31-2005 05:28 PM
to 2.6.10 from 2.4.26 | ssh client | Host key verification failed kaN5300 Slackware 6 01-05-2005 10:04 PM
SSH rejects my host key for version 2 only. Travis86 Linux - Networking 19 08-08-2003 03:48 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration