LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-15-2010, 03:02 AM   #1
shyl
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
LADP User Unable to Login via SSH


Hi there,
My case is that, the LADP user connected could not login via SSH. This user could login in the system console. And all the other users could login within ssh. And I was wondering whether any one could suggest which place to check next. And here is the detail:
I was using SUSE 11.3 when I met this error. PAM module is used, and the corresponding files in /etc/pam.d/ have all been updated. Here is what I've added:

Code:
yl-1:/etc/pam.d # fgrep ldap *pc
common-account-pc:account     [default=bad success=ok user_unknown=ignore] pam_ldap.so
common-auth-pc:auth     sufficient      pam_ldap.so     use_first_pass
common-password-pc:password    sufficient    pam_ldap.so use_authtok
common-session-pc:session     optional      pam_ldap.so
And here is what I've found in /var/log/message

Code:
Sep 15 15:03:06 yl-1 sshd[8252]: error: PAM: Permission denied for Admin_333333 from 192.168.99.27
 
Old 09-15-2010, 03:18 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,695

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Have you checked you sshd_config? For example:
Code:
grep UsePAM /etc/ssh/sshd_config
Another thing to do would be temporarily run sshd in debug mode (sshd -d) and try to ssh in as that user. You should then get much more information than the single log line you posted.

Cheers,

Evo2.
 
Old 09-15-2010, 09:33 PM   #3
shyl
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Hi Evo2,
The result returned from

Code:
grep UsePAM /etc/ssh/sshd_config
is

Code:
UsePAM yes
And your suggetion of running sshd with -d option does produce something, but quite beyond my knowledge. :-( Anyone can interpret this. The user admin_333333 is supposed to be the one retrieved from LDAP server.

Code:
debug2: input_userauth_request: try method none
debug3: monitor_read: checking request 45
debug1: PAM: initializing for "admin_333333"
debug1: PAM: setting PAM_RHOST to "192.168.99.27"
debug1: PAM: setting PAM_TTY to "ssh"
debug2: monitor_read: 45 used once, disabling now
debug3: mm_request_receive entering
debug3: monitor_read: checking request 3
debug3: mm_answer_authserv: service=ssh-connection, style=
debug2: monitor_read: 3 used once, disabling now
debug3: mm_request_receive entering
debug1: userauth-request for user admin_333333 service ssh-connection method keyboard-interactive
debug1: attempt 1 failures 0
debug2: input_userauth_request: try method keyboard-interactive
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=admin_333333 devs=
debug1: kbdint_alloc: devices 'pam'
debug2: auth2_challenge_start: devices pam
debug2: kbdint_next_device: devices <empty>
debug1: auth2_challenge_start: trying authentication method 'pam'
debug3: mm_sshpam_init_ctx
debug3: mm_request_send entering: type 48
debug3: mm_sshpam_init_ctx: waiting for MONITOR_ANS_PAM_INIT_CTX
debug3: mm_request_receive_expect entering: type 49
debug3: mm_request_receive entering
debug3: monitor_read: checking request 48
debug3: mm_answer_pam_init_ctx
debug3: PAM: sshpam_init_ctx entering
debug3: mm_request_send entering: type 49
debug3: mm_request_receive entering
debug3: mm_sshpam_query
debug3: mm_request_send entering: type 50
debug3: mm_sshpam_query: waiting for MONITOR_ANS_PAM_QUERY
debug3: mm_request_receive_expect entering: type 51
debug3: mm_request_receive entering
debug3: monitor_read: checking request 50
debug3: mm_answer_pam_query
debug3: PAM: sshpam_query entering
debug3: ssh_msg_recv entering
debug3: PAM: sshpam_thread_conv entering, 1 messages
debug3: ssh_msg_send: type 1
debug3: ssh_msg_recv entering
debug3: mm_request_send entering: type 51
debug3: mm_request_receive entering
debug3: mm_sshpam_query: pam_query returned 0
Postponed keyboard-interactive for admin_333333 from 192.168.99.27 port 65421 ssh2
debug3: mm_sshpam_respond
debug3: mm_request_send entering: type 52
debug3: mm_sshpam_respond: waiting for MONITOR_ANS_PAM_RESPOND
debug3: mm_request_receive_expect entering: type 53
debug3: mm_request_receive entering
debug3: monitor_read: checking request 52
debug3: mm_answer_pam_respond
debug2: PAM: sshpam_respond entering, 1 responses
debug3: ssh_msg_send: type 6
debug3: mm_request_send entering: type 53
debug3: mm_request_receive entering
debug3: mm_sshpam_respond: pam_respond returned 1
debug3: mm_sshpam_query
debug3: mm_request_send entering: type 50
debug3: mm_sshpam_query: waiting for MONITOR_ANS_PAM_QUERY
debug3: mm_request_receive_expect entering: type 51
debug3: mm_request_receive entering
debug3: monitor_read: checking request 50
debug3: mm_answer_pam_query
debug3: PAM: sshpam_query entering
debug3: ssh_msg_recv entering
debug3: ssh_msg_send: type 7
debug3: PAM: Authentication failure
PAM: Permission denied for admin_333333 from 192.168.99.27
debug3: mm_request_send entering: type 51
debug3: mm_request_receive entering
debug3: mm_sshpam_query: pam_query returned -1
debug2: auth2_challenge_start: devices <empty>
debug3: mm_sshpam_free_ctx
debug3: mm_request_send entering: type 54
debug3: mm_sshpam_free_ctx: waiting for MONITOR_ANS_PAM_FREE_CTX
debug3: mm_request_receive_expect entering: type 55
debug3: mm_request_receive entering
debug3: monitor_read: checking request 54
debug3: mm_answer_pam_free_ctx
debug3: PAM: sshpam_free_ctx entering
debug3: PAM: sshpam_thread_cleanup entering
debug3: mm_request_send entering: type 55
debug2: monitor_read: 54 used once, disabling now
Failed keyboard-interactive/pam for admin_333333 from 192.168.99.27 port 65421 ssh2
Quote:
Originally Posted by evo2 View Post
Have you checked you sshd_config? For example:
Code:
grep UsePAM /etc/ssh/sshd_config
Another thing to do would be temporarily run sshd in debug mode (sshd -d) and try to ssh in as that user. You should then get much more information than the single log line you posted.

Cheers,

Evo2.
 
Old 09-15-2010, 09:48 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,695

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Hi,

a line of interest in the sshd output is:
Quote:
debug3: PAM: Authentication failure
So it seems that the pam authentication is enabled but failing for some reason.

While I do have some experience debugging ssh auth failures, I don't have specific experience with pam/ldap configuration.

A quick google on the topic provided the following (here at lq):

http://wiki.linuxquestions.org/wiki/Pam_ldap

Perhaps you could check to make sure your configuration is consistent with what is described there.

HTH,

Evo2.
 
Old 09-15-2010, 09:48 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,695

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Hi,

a line of interest in the sshd output is:
Quote:
debug3: PAM: Authentication failure
So it seems that the pam authentication is enabled but failing for some reason.

While I do have some experience debugging ssh auth failures, I don't have specific experience with pam/ldap configuration.

A quick google on the topic provided the following (here at lq):

http://wiki.linuxquestions.org/wiki/Pam_ldap

Perhaps you could check to make sure your configuration is consistent with what is described there.

HTH,

Evo2.
 
Old 09-16-2010, 03:10 AM   #6
shyl
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you Evo2. I created another VM and followed the steps instructed by http://wiki.linuxquestions.org/wiki/Pam_ldap and now this AD user is able to log with SSH. Guess there must be something wrong in my original /etc folder, but I just cannot tell where.

Lei

Quote:
Originally Posted by evo2 View Post
Hi,

a line of interest in the sshd output is:

So it seems that the pam authentication is enabled but failing for some reason.

While I do have some experience debugging ssh auth failures, I don't have specific experience with pam/ldap configuration.

A quick google on the topic provided the following (here at lq):

http://wiki.linuxquestions.org/wiki/Pam_ldap

Perhaps you could check to make sure your configuration is consistent with what is described there.

HTH,

Evo2.
 
  


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
unable to login as user; can login as root. rksanders Debian 24 02-09-2011 08:01 AM
Pls help: unable to login as normal user through ssh Baps Linux - Server 23 03-16-2009 06:52 PM
SSH problem - unable to login at times vikas027 Linux - Newbie 6 02-28-2009 07:14 AM
Unable to login via console or SSH predatorz Fedora 8 01-07-2008 12:17 AM
Unable to login via console or SSH predatorz Linux - General 3 01-05-2008 07:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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