LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-01-2005, 11:10 AM   #1
menator
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Rep: Reputation: 0
SSH public keys not working - RH 7.3


Ok I know this is a common problem but I've checked the basics and I still cannot get it to work...

I am trying to set up ssh over two servers using public keys instead of using passwords.
I did the following:

ssh-keygen -t rsa

and it creates the files in the usal dir .ssh/id.rsa and .ssh/id_rsa.pub

I then copy the .pub file to the server i wish to connect to:
scp .ssh/id_rsa.pub <server>:.ssh/authorized_keys2


I then checked the permissions on the files/dirs so that we have:

server1:
drwx------ .ssh
|
-rw------- id_rsa
-rw-r--r-- id_rsa.pub

server2:
drwx------ .ssh
|
-rw-r--r-- authorized_keys2


This is correct is it not?

Whenever i try to ssh to server2 from server1 i get a password prompt. Is there anything else that could be causing the problem? Maybe something specific to RH7.3?
 
Old 11-01-2005, 11:35 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Re: SSH public keys not working - RH 7.3

Hi, and welcome to LQ!

Quote:
Originally posted by menator
server2:
drwx------ .ssh
|
-rw-r--r-- authorized_keys2
Where did that two come from?



Cheers,
Tink

Last edited by Tinkster; 11-01-2005 at 11:36 AM.
 
Old 11-01-2005, 01:06 PM   #3
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
It all depends on how your /etc/ssh/sshd_config is setup.

Please check that you do have 'pubkey authentication' enabled and that the file is named correctly as above poster mentions.
 
Old 11-02-2005, 04:11 AM   #4
menator
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Original Poster
Rep: Reputation: 0
I checked the config file and the 'pubkey authentication' line is commented out meaning it must be using the default, which is 'yes'.

The reason for the '2' is that it was stated in my O'Reilly book, perhaps that was a typo. I tried removing the 2 and it made no difference.
 
Old 11-02-2005, 08:18 AM   #5
menator
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Could it have anything to so with user accounts? I will not be using this logged on as root but as another user.
I cant seem to find anything else that could be causing the problem.
 
Old 11-02-2005, 09:03 AM   #6
menator
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Original Poster
Rep: Reputation: 0
On further thought it may still be a permissions issue, this time with the home directory. At the moment my home dir is full access 777. Perhaps thats why ssh doesnt like it when I try to use pulic keys.
I'll check it out.
 
Old 11-02-2005, 11:26 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
No, 777 on the home wouldn't affect that (but it's a bad
idea).

Another common problem for authorized_keys is the way
they get transferred from one machine to the other. Check
that the file on the server does have the public key in
ONE line.


Cheers,
Tink

Last edited by Tinkster; 11-02-2005 at 11:30 AM.
 
Old 11-03-2005, 03:55 AM   #8
menator
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Just checked and it is all on one line.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh public/private keys lord_darkhelmet Linux - Newbie 8 10-29-2005 03:14 PM
SSH public / private keys problem guideweb Linux - Software 7 08-27-2005 09:49 PM
SSH Public Keys Problems Temujin_12 Linux - Security 4 02-23-2005 12:43 PM
How to delete public & private keys for SSH? TrulyTessa Linux - Security 2 11-18-2004 12:27 PM
Help with SSH and public/private keys stodge Linux - Security 5 05-14-2003 01:22 PM


All times are GMT -5. The time now is 06:39 AM.

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