LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2011, 05:31 AM   #1
warwolf
LQ Newbie
 
Registered: May 2005
Location: Sweden
Distribution: Kubuntu 11.04
Posts: 10

Rep: Reputation: 0
SSH & RSA public key problems, works only for certain users?


Have a strange problem i cant get my head around.
I have a Debian (6.0.1 Squeeze) server and a Kubuntu (11.04 Natty Narwhal) client machine up and running.
Trying to create a pubkey login from client and it works perfectly with user1(uid 1000), however with user2(uid 1002) it fails.

Starting from scratch without any .ssh folders in client home or any of the users on server.
On the client i run
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-copy-id user1@debian.server.com
ssh-copy-id user2@debian.server.com

ssh user1@debian.server.com - works fine
ssh user2@debian.server.com - requires password?

Debug for user1
debug1: Offering RSA public key: /home/daniel_andersson/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp <key>
debug3: sign_and_send_pubkey: RSA <key>
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).

Debug for user2
debug1: Offering RSA public key: /home/username/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/username/.ssh/id_dsa
debug3: no such identity: /home/username/.ssh/id_dsa
debug1: Trying private key: /home/username/.ssh/id_ecdsa
debug3: no such identity: /home/username/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

Diff shows that on server /home/user1/.ssh/authorized_keys /home/user2/.ssh/authorized_keys are identical
And on client known_hosts got two keys that looks correct

Nothing in the sshd_config or pam auth for sshd that is userspecific as i can see.

Anyone know what the problem might be?

Solved:
Problem was incorrect permissions on the home folder.

Last edited by warwolf; 05-27-2011 at 05:41 AM. Reason: Solved it myself
 
Old 05-27-2011, 06:11 AM   #2
redgoblin
Member
 
Registered: Jun 2005
Location: UK
Distribution: Debian
Posts: 189

Rep: Reputation: 41
Just replying to take you off the zero reply list.

Before I got to the bottom of your post I was already thinking permissions. Good trouble shooting piont with SSH is to check ownership and permissions on the .ssh directory as well as the known keys file (or in your case the users home directory).

Glad you got it sorted.
 
Old 05-27-2011, 06:17 AM   #3
warwolf
LQ Newbie
 
Registered: May 2005
Location: Sweden
Distribution: Kubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
Bit embarrassing, was one of the first thing i did check however must have checked wrong home directory
Then i did a tail on /var/log/auth.log that did warn for wrong permssions
 
  


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
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
Which is better RSA or DSA public key? tarballedtux Linux - Security 12 02-03-2009 06:15 AM
Possible to have multiple SSH accounts & clients using the same RSA key on server?? a2brute Linux - Server 2 03-31-2008 12:25 PM
Newbie: ssh without public key still works? aleet2600 Linux - Security 5 04-15-2004 03:10 PM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:34 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
Open Source Consulting | Domain Registration