LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 10-29-2012, 11:44 AM   #1
jasono
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
Passwordless SSH behaving oddly


I need to get passwordless SSH working between two red hat VMs. Here's the scenario:

On both VMs I have user bob. On VM1 as user bob I run ssh-keygen -t rsa. Then as user bob I run ssh-copy-id i bob@<ip of vm2>. I enter bobs password on vm2 and the public key is copied over to the authorized_keys file. I've verified that the key listed in the authorized keys file on vm2 is the same as the id_rsa.pub key on vm1. I've also verified that the permissions of bobs home, home/.ssh, home/.ssh/id_rsa, and home/.ssh/id_rsa.pub are correct.

Now I should be able to simply run the command 'ssh bob@<ip of vm2> and immediately get a terminal on vm2. Instead I'm still prompted for a password.

I've found that if I run these two commands on vm2 it will work:
(as root)
service sshd stop
/usr/sbin/sshd
(running 'service sshd start' does not work)

After running those two commands I can run the command 'ssh bob@<ip of vm2>' and get a terminal with no password required. What's going on here?
 
Old 10-29-2012, 05:43 PM   #2
larvel
LQ Newbie
 
Registered: Jun 2012
Posts: 29

Rep: Reputation: Disabled
Is public key authentication enabled in sshd config?
 
Old 10-30-2012, 01:13 AM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
Quote:
running 'service sshd start' does not work
well, it should, so have you looked at the msgs/logs in detail?
What version of RHEL is this, what VM tool eg Xen or KVM?
 
Old 10-30-2012, 09:36 AM   #4
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 548
Blog Entries: 5

Rep: Reputation: Disabled
Main reason for ssh passwordless failure could be permission .Cross check whether you had enable wright permission for keys & .ssh file
Check the sshd_ config file you had whether enable authorized_ keys file path file & pubkey attentication yes in your sshd_ config file

Look after the link for passwordless login

http://www.linuxquestions.org/questi...os-rhel-35029/
 
Old 10-31-2012, 09:16 PM   #5
jasono
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the help everyone. It turns out that there was an issue with the user's home directory. I had used puppet to create the users (does RHEL encrypt the home dir by default?). When I changed the location of the authorized_keys file to a different directory and point the sshd_config to that new directory everything worked fine.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard disk behaving oddly Changes Linux - Hardware 4 05-10-2012 08:31 AM
[SOLVED] Terminals behaving oddly all except xterm Josh000 Slackware 8 04-24-2010 03:33 PM
Quantum DLT-V4 Tape Drive Behaving Oddly davidstvz *BSD 0 09-18-2008 04:54 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Amarok behaving oddly little_penguin Linux - Software 2 07-10-2005 11:58 AM


All times are GMT -5. The time now is 04:21 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