LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-22-2015, 10:54 PM   #1
abhisheks77
Member
 
Registered: Apr 2014
Posts: 63

Rep: Reputation: Disabled
ssh keys not working on RHEL 6.5


Hello,
I am facing a issue on RHEL 6.5. For other versions, it is working. I have setup bdbdunix to login to vmrhel02 with ssh keys, without password. But it is not getting successful. Permissions seems to be ok, I am not sure, where it is stuck. Can somebody give some pointer ?
dliptr13 is source server and vmrhel02 is destination.
Code:
root@dliptr13:~> su - bdbdunix
bdbdunix@dliptr13:/home/bdbdunix> ls -ld .
drwxr-xr-x 10 bdbdunix bdna 2048 Apr 22 20:45 .
bdbdunix@dliptr13:/home/bdbdunix> ls -ld .ssh
drwx------ 2 bdbdunix bdna 1024 Apr  1 12:38 .ssh
bdbdunix@dliptr13:/home/bdbdunix> cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0sBVzBu3fSNvvK15nk4TLFQzou8RbMtv864rCIwd/0HVmh61YGcKhGK2DPI/rTMTsozW+LGL/mTObwW1KG+cgQytwz0v9mb7wO9scM7JOaNQi+mxvs0u+ABCdSkvUUyVu+snVwiHR2mOauqb+3sXM7wsot59SmDqo+NYCjORhKrDJ+baFQfI1Bv5oRxL2+a0mKw1mnMEtvv7qT1PZ83025DdJFgGhpeisdvbd21yIgsZ6MLir4CEtECoT1kU7Cd52p6B/4BWzv0z+2H+vkLiAjOkxe4ZYW57KrOqmWlLdcx37il8hBvLUkywMAvx8BpBjItKkZVC+5abkZPaC5KHUQ== bdbdunix@dliptr13
bdbdunix@dliptr13:/home/bdbdunix>
bdbdunix@dliptr13:/home/bdbdunix/.ssh> ssh bdbdunix@vmrhel02
bdbdunix@vmrhel02's password:
bdbdunix@dliptr13:/home/bdbdunix/.ssh>
[CODE][/[root@vmrhel02 ~]# su - bdbdunix
[bdbdunix@vmrhel02 ~]$ cd .ssh
[bdbdunix@vmrhel02 .ssh]$ ls -latr
total 28
-rw-r--r--. 1 bdbdunix bdna 399 Mar 25 12:16 id_rsa.pub
-rw-------. 1 bdbdunix bdna 1675 Mar 25 12:16 id_rsa
-rw-------. 1 bdbdunix bdna 399 Apr 1 12:38 authorized_keys
-rw-r--r--. 1 bdbdunix bdna 5499 Apr 22 11:53 known_hosts
drwx------. 2 bdbdunix bdna 4096 Apr 22 16:36 .
drwx------. 5 bdbdunix bdna 4096 Apr 22 20:38 ..
[bdbdunix@vmrhel02 .ssh]$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0sBVzBu3fSNvvK15nk4TLFQzou8RbMtv864rCIwd/0HVmh61YGcKhGK2DPI/rTMTsozW+LGL/mTObwW1KG+cgQytwz0v9mb7wO9scM7JOaNQi+mxvs0u+ABCdSkvUUyVu+snVwiHR2mOauqb+3sXM7wsot59SmDqo+NYCjORhKrDJ +baFQfI1Bv5oRxL2+a0mKw1mnMEtvv7qT1PZ83025DdJFgGhpeisdvbd21yIgsZ6MLir4CEtECoT1kU7Cd52p6B/4BWzv0z+2H+vkLiAjOkxe4ZYW57KrOqmWlLdcx37il8hBvLUkywMAvx8BpBjItKkZVC+5abkZPaC5KHUQ== bdbdunix@dliptr13
[bdbdunix@vmrhel02 .ssh]$CODE]
 
Old 04-23-2015, 06:48 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
If you are trying to login to vmrhel02 from dliptr13 then dliptr13 is the client and vmrhel02 is the server. It appears that you have the public key on the client instead of the private key id_rsa.
 
Old 04-23-2015, 10:28 AM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
check out the links at the bottom of this post in my sig. your permissions are also wrong.
 
Old 04-23-2015, 11:48 AM   #4
abhisheks77
Member
 
Registered: Apr 2014
Posts: 63

Original Poster
Rep: Reputation: Disabled
I fixed permissions, but it didn't helped
[CODE][/bdbdunix@dliptr13:/home/bdbdunix> ls -ld ~
drwx------ 10 bdbdunix bdna 2048 Apr 23 09:39 /home/bdbdunix
bdbdunix@dliptr13:/home/bdbdunix> ls -l .ssh
total 32
-rw------- 1 bdbdunix bdna 399 Apr 1 12:38 authorized_keys
-rw------- 1 bdbdunix bdna 1675 Mar 25 12:16 id_rsa
-rw-r--r-- 1 bdbdunix bdna 399 Mar 25 12:16 id_rsa.pub
-rw-r--r-- 1 bdbdunix bdna 364659 Apr 23 09:45 known_hosts
bdbdunix@dliptr13:/home/bdbdunix>
===============================================================
[bdbdunix@vmrhel02 ~]$ ls -ld ~
drwx------. 5 bdbdunix bdna 4096 Apr 23 09:39 /home/bdbdunix
[bdbdunix@vmrhel02 ~]$ ls -l .ssh
total 20
-rw-------. 1 bdbdunix bdna 399 Apr 1 12:38 authorized_keys
-rw-------. 1 bdbdunix bdna 1675 Mar 25 12:16 id_rsa
-rw-r--r--. 1 bdbdunix bdna 399 Mar 25 12:16 id_rsa.pub
-rw-r--r--. 1 bdbdunix bdna 5499 Apr 22 11:53 known_hosts
[bdbdunix@vmrhel02 ~]$CODE]
 
Old 04-23-2015, 12:23 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Lets try some debugging.
Post the output of
ssh -v bdbdunix@vmrhel02
 
Old 04-23-2015, 12:36 PM   #6
abhisheks77
Member
 
Registered: Apr 2014
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Lets try some debugging.
Post the output of
ssh -v bdbdunix@vmrhel02
Code:
bdbdunix@dliptr13:/home/bdbdunix> ssh -v bdbdunix@vmrhel02
OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to vmrhel02 [10.63.73.87] port 22.
debug1: Connection established.
debug1: identity file /home/bdbdunix/.ssh/identity type -1
debug1: identity file /home/bdbdunix/.ssh/id_rsa type 1
debug1: identity file /home/bdbdunix/.ssh/id_dsa 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_4.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'vmrhel02' is known and matches the RSA host key.
debug1: Found key in /home/bdbdunix/.ssh/known_hosts:14
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/bdbdunix/.ssh/identity
debug1: Offering public key: /home/bdbdunix/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/bdbdunix/.ssh/id_dsa
debug1: Next authentication method: password
bdbdunix@vmrhel02's password:
bdbdunix@dliptr13:/home/bdbdunix>
 
Old 04-23-2015, 02:08 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Looks like the server does not like the private key. Looks like they were generated at the same time.

You can use additional v to gather more debug information.

ssh -vvv bdbdunix@vmrhel02
 
Old 04-23-2015, 03:38 PM   #8
abhisheks77
Member
 
Registered: Apr 2014
Posts: 63

Original Poster
Rep: Reputation: Disabled
I got it fixed. iptables was on.
 
Old 04-23-2015, 03:46 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Great. You can mark the thread as solved by selecting the thread tools pull down menu at the top.
 
  


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 keys not working coelhoapm Linux - Security 3 11-07-2012 10:12 PM
ssh using keys not working deadlock Linux - Newbie 4 01-11-2008 03:37 AM
ssh using keys not working deadlock Linux - Newbie 1 01-10-2008 08:41 AM
SSH keys not working GATTACA Linux - Server 8 07-10-2007 10:59 AM
SSH public keys not working - RH 7.3 menator Linux - Newbie 7 11-03-2005 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:29 PM.

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