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 10-04-2007, 11:59 AM   #1
mpmackenna
Member
 
Registered: May 2006
Posts: 69

Rep: Reputation: 15
Shared key authentication and Putty


So what's the magic step to make shared key authentication work between Putty on a Windows box as the client, and Mandriva 2007.1 SSH server. I create my key pair in PuttyGen about every different way that's possible and I load the private key into Putty successfully and place my public key from Putty into user's authorized_keys with "cat key.pub >> authorized_keys" on SSH server, but I always get the message "server rejected our key". Anybody have any idea as to what I am missing? Any help is greatly appreciated. Thanks, Mike

Last edited by mpmackenna; 10-04-2007 at 12:00 PM.
 
Old 10-04-2007, 01:23 PM   #2
phpnewb72
LQ Newbie
 
Registered: Aug 2005
Location: Fresno, CA
Distribution: Ubuntu, FC8 x64, Centos
Posts: 29

Rep: Reputation: 15
shared key

try authorized_keys2 instead of authorized_keys, seen that work going across various flavors of linux.
 
Old 10-04-2007, 02:58 PM   #3
mpmackenna
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 15
Good tip, but I checked into it and my distro uses the authorized_keys file as opposed to the authorized_keys2 file. Appreciate it just the same though. Mike
 
Old 10-04-2007, 03:22 PM   #4
phpnewb72
LQ Newbie
 
Registered: Aug 2005
Location: Fresno, CA
Distribution: Ubuntu, FC8 x64, Centos
Posts: 29

Rep: Reputation: 15
does it work without any ~/.sshd/authorized_keys? also, check the formatting of the file; any leading characters, line breaks, etc. I believe that it should be one long line.
 
Old 10-04-2007, 04:31 PM   #5
mpmackenna
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 15
Apparently it is not just a putty issue. I tried using shared key authentication between two linux boxes, and had the same issue. Shared key authentication works just fine for my CentOS box, but when I try to use it on my Mandriva box it resorts back to password authentication. I looked at the sshd_config file and it looks correct, it is almost identical to the sshd_config on my CentOS box. It really has me scratching my head. Did you mean ~/.ssh/authorized_keys in the line above? I don't see how it could work without anything in that file, that is what it checks against. Perhaps I am misunderstanding your post. Thanks, Mike
 
Old 10-18-2007, 11:38 AM   #6
Erebus Bat
LQ Newbie
 
Registered: Jul 2004
Distribution: Ubuntu 10.04 (Lucid)
Posts: 25

Rep: Reputation: 15
Take a gander at your sshd_config file there should be an AuthorizedKeysFile directive that dictates where the file should be located.

Also check the StrictModes directive, if it is enabled and the key file is writeable to anyone besides the user it will not use public key authentication for that user as anyone could append their own key to the file and gain access as that user. A chmod 600 on the authorized_keys (or whatever it is called) should fix that.
 
Old 10-24-2007, 06:46 PM   #7
mpmackenna
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 15
That was it....

That was it, I had rw access for the group and r access for everybody. I changed it to 600 and now it works. Thanks! Mike
 
Old 10-25-2007, 09:01 AM   #8
Erebus Bat
LQ Newbie
 
Registered: Jul 2004
Distribution: Ubuntu 10.04 (Lucid)
Posts: 25

Rep: Reputation: 15
Glad it worked out for you.

Too bad it took 20 days

At least it is working for you now.
 
Old 10-25-2007, 09:06 AM   #9
mpmackenna
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Erebus Bat View Post
Glad it worked out for you.

Too bad it took 20 days

At least it is working for you now.
No worries, thanks for the help.
 
  


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
enable shared key authentication for wlan card on freeBSD cccc *BSD 3 08-14-2005 08:25 PM
public/private key authentication with PuTTY NetAX Linux - Security 5 10-27-2004 06:00 PM
PuTTY authentication asb Linux - Networking 3 04-05-2004 12:26 PM
emacs key bindings within putty |2ainman Programming 0 04-01-2004 12:43 PM
Putty weirding up key mappings jbeninger Linux - Software 0 08-04-2003 09:21 PM


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