LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-26-2014, 01:07 PM   #1
elviejito
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Rep: Reputation: Disabled
ssh fingerprint not matching - home user


When I try to copy files from the Desktop to the Laptop via rsync (once id_rsa and id_rsa.pub have been generated on each machine), the fingerprint that ssh reports is different from the fingerprint I get on the Laptop when running "ssh-keygen -lf /home/user/.ssh/id_rsa" (and id_rsa.pub).
Both machines are 64-bit, running centos latest version and updated.
The fingerprint I get running "ssh-keygen -lf" on the Laptop RSA files is: 2048 71:05:f9:b1:ed:ca:5e:eb:6e:3d:a7:9b:a2:da:70 ssh_host_rsa_key.pub (RSA)
When I run "rsync /home/user1/directory user2@192.168.1.130:/home/user2" from the desktop (192.168.1.130 is the URL of the Laptop), I get the following message: "The fingerprint for the RSA key sent by the remote host is 7c:2f:a3:50:96:c0:fb:fb:6f:be:c5:3e:3e:dd:2c:a5." (????) It is clearly not the same fingerprint and I don't understand how this could be possible.
The firewalls on both machines allow access at port 22.
Both computers have sshd_config ServerKeyBits set to 2048 bytes.
I get the same message whether connecting to the laptop by wireless or cable.
Disconnecting the router from the internet makes no difference.
The Desktop connects to my commercial website host via ssh without any problem.
The Laptop connects to the Desktop via ssh or rsync without problem.
The only weirdness is when I try to get the Desktop to connect to the Laptop via ssh or rsync.
I recently had the Laptop hard drive encrypted; could that be the cause of the problem? Or how can there be a man in the middle on a local network?
Any suggestions would be greatly appreciated.

Last edited by elviejito; 04-26-2014 at 01:09 PM.
 
Old 04-26-2014, 02:55 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
read the links in the signature. that should help.
 
Old 04-27-2014, 10:56 PM   #3
elviejito
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
results of verbose SSH

I read through the items in the signature and confirmed that they were all being used.

I don't know if this helps, but here is the verbose version of the SSH attempt:
[jjd@computer4 .ssh]$ ssh -vvv Jack@192.168.1.130
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.130 [192.168.1.130] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/jjd/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/jjd/.ssh/id_rsa type 1
debug1: identity file /home/jjd/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug3: Wrote 960 bytes for a total of 981
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-dss...00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug3: Wrote 24 bytes for a total of 1005
debug2: dh_gen_key: priv key bits set: 133/256
debug2: bits set: 494/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: Wrote 144 bytes for a total of 1149
debug3: check_host_in_hostfile: host 192.168.1.130 filename /home/jjd/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /home/jjd/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /home/jjd/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /etc/ssh/ssh_known_hosts
debug2: no key of type 0 for host 192.168.1.130
debug3: check_host_in_hostfile: host 192.168.1.130 filename /home/jjd/.ssh/known_hosts2
debug3: check_host_in_hostfile: host 192.168.1.130 filename /etc/ssh/ssh_known_hosts2
debug3: check_host_in_hostfile: host 192.168.1.130 filename /home/jjd/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.1.130 filename /etc/ssh/ssh_known_hosts
debug2: no key of type 2 for host 192.168.1.130
The authenticity of host '192.168.1.130 (192.168.1.130)' can't be established.
RSA key fingerprint is 7c:2f:a3:50:96:c0:fb:fb:6f:be:c5:3e:3e:dd:2c:a5.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
________________________________________________________

Again, the RSA key fingerprint retrieved by ssh is not the same as the fingerprint found on the remote machine using "ssh-keygen -lf .ssh/id_rsa [or id_rsa.pub]"

Thanks for any suggestions.
 
Old 04-28-2014, 03:09 AM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
When I run "rsync /home/user1/directory user2@192.168.1.130:/home/user2" from the desktop (192.168.1.130 is the URL of the Laptop), I get the following message: "The fingerprint for the RSA key sent by the remote host is 7c:2f:a3:50:96:c0:fb:fb:6f:be:c5:3e:3e:dd:2c:a5." (????) It is clearly not the same fingerprint and I don't understand how this could be possible.
the remote host fingerprints are the the fingerprints of the host key, which is likely not the key you generated with ssh-keygen. look for host key in /etc/ssh/.
 
1 members found this post helpful.
Old 04-29-2014, 11:38 AM   #5
elviejito
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Good point! But what I get when I run "ssh-keygen -lf /etc/ssh/ssh_host_key" is a third key:2048 a0:22:55:60:11:49:b6:dc:f7:70:7e:97:19:01:33:3e (RSA1); so I'm still at a loss.

But thanks.
 
Old 04-29-2014, 11:58 AM   #6
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by elviejito View Post
Good point! But what I get when I run "ssh-keygen -lf /etc/ssh/ssh_host_key" is a third key:2048 a0:22:55:60:11:49:b6:dc:f7:70:7e:97:19:01:33:3e (RSA1); so I'm still at a loss.

But thanks.
Have you run that command on the laptop ("remote", in your case) and that's the output?
 
Old 04-29-2014, 12:49 PM   #7
elviejito
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
ssh-keygen

Yes, I have. Running "ssh-keygen (laptop)/etc/ssh/host_key gives me a totally different fingerprint. On the other hand, When I access the desktop from the laptop via ssh, I get the same fingerprint as when I run (desktop)/home/user/.ssh/id-rsa (or id-rsa.pub).
Thanks.
 
Old 04-29-2014, 09:32 PM   #8
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
do you have other keys in /etc/ssh of the destination, e.g. /etc/ssh/ssh_host_rsa_key? what are their fingerprint?

Code:
# cd /etc/ssh
# for i in *key; do ssh-keygen -f $i -l; done

Last edited by Berhanie; 04-29-2014 at 09:36 PM.
 
Old 04-30-2014, 10:33 AM   #9
elviejito
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
SSH key not matching

Thanks! I did run "ssh-keygen -lf /etc/ssh/ssh_host_rsa_key" on the laptop and it gave me the same key I get running against id_rsa and id_rsa.pub. This laptop key is different from the key I get running ssh User@<laptop_IP> from the desktop.
 
  


Reply



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
SSH and User Home Directory htabesh Linux - Security 3 10-29-2008 08:13 AM
User Creationg : ssh/sftp user jail to $HOME only routers Solaris / OpenSolaris 2 10-29-2007 11:28 PM
Locking SSH user to home directory. paroxsitic Linux - Software 2 04-03-2007 05:50 PM
algorithm for fingerprint matching applee Programming 2 02-05-2007 01:02 AM
Algorithm for fingerprint matching applee General 0 01-30-2007 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:48 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration