LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-10-2008, 07:50 AM   #1
deadlock
Member
 
Registered: Apr 2003
Distribution: Red Hat
Posts: 65

Rep: Reputation: 15
Unhappy ssh using keys not working


I have 2 servers - let's call them A and B. I want to run a dump on Server A, push it down an SSH tunnel and write it to a tape drive on Server B.

I have the code for this elsewhere, however the ssh tunnel is not working for me.

What I am doing:

1) On server A: ssh-keygen -t rsa. No Passphrase entered.
Creates files id_rsa and id_rsa.pub in the folder ~/.ssh

2) scp id_rsa.pub Server B./ssh/id_rsa.pub
Server B asks for password at this point and adds server B to known_hosts. I now have id_rsa.pub in the same location as id_rsa on Server A. So far so good

3) This is where there is some confusion. Various walkthrough advise copying id_rsa.pub to authorized_keys, authorized_keys2, or using cat to do the same. Anyway, I've tried a few options.

4) Exit from server B.

5) Attempt to ssh from server A to Server B

6) Server B asks for users password! All the tutorials say I should be done.

Any more tips? Do I need to have configured / be running something else?
 
Old 01-10-2008, 09:15 AM   #2
deadlock
Member
 
Registered: Apr 2003
Distribution: Red Hat
Posts: 65

Original Poster
Rep: Reputation: 15
Managed to find the solution. Most turorials / walkthoughs don't go into detail on how sshd needs to be configured.

The following link was buried in another similar question to this and had the details required to make this work:

ssh with keys
 
Old 01-10-2008, 09:18 AM   #3
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 297

Rep: Reputation: 49
Quote:
Originally Posted by deadlock View Post
3) This is where there is some confusion. Various walkthrough advise copying id_rsa.pub to authorized_keys, authorized_keys2, or using cat to do the same. Anyway, I've tried a few options.
That's the part you are missing then. Just having id_rsa.pub in that directory won't do anything, you have to add it's content to the file 'authorized_keys' on the server.
Typically, you'd do
Code:
cat id_rsa.pub >> ~/.ssh/authorized_keys
to append your public key to the file, as you might collect more than one key in there (one for each client you are connecting from). You can then remove the file id_rsa.pub.

Make sure you don't misspell 'authorized_keys'. If it still doesn't work, double check the spelling first. )
 
Old 01-10-2008, 03:25 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Heh ... you *could* have stumbled across this in the tutorial section.



Cheers,
Tink
 
Old 01-11-2008, 03:37 AM   #5
deadlock
Member
 
Registered: Apr 2003
Distribution: Red Hat
Posts: 65

Original Poster
Rep: Reputation: 15
Cheers

That has the same flaw as most that I came across - no run through of the sshd.conf settings.

Most of the tutorials stop once the public key is in authorized_keys on the server :-(

Not sure what I was missing, but the tutorial I linked to aboce does at least go through the sshd.conf...
 
  


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 keys not working GATTACA Linux - Server 8 07-10-2007 10:59 AM
ssh keys sachin1361 Linux - Enterprise 9 03-12-2007 05:18 PM
SSH public keys not working - RH 7.3 menator Linux - Newbie 7 11-03-2005 03:55 AM
Configuring SSH to accept only keys (already have keys) fr0st Linux - Security 3 11-04-2003 03:31 AM
Working with SSH and multiple private keys IgD Linux - Security 2 09-08-2003 10:07 PM


All times are GMT -5. The time now is 08:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration