Menu

#35 Not getting auth token

open
nobody
None
5
2014-08-26
2008-10-16
Anonymous
No

I have a problem with pam_mysql not getting my auth token when configured for sshd.
The only auth module in /etc/pam.d/sshd is this:
<sshd>
auth required pam_mysql.so user=root \ passwd=blar \ host=localhost \ db=ispdb \ verbose=1 \ table=users \ usercolumn=name \ passwdcolumn=password \ crypt=0
</sshd>

I have changed line 2569 (revision 1.26) from:
syslog(LOG_AUTHPRIV | LOG_ERR, PAM_MYSQL_LOG_PREFIX "pam_mysql_check_passwd() called.");

...to:
syslog(LOG_AUTHPRIV | LOG_ERR, PAM_MYSQL_LOG_PREFIX "pam_mysql_check_passwd('%s','%s') called.", user, passwd);

The following is a login session log from /var/log/auth.log:
<auth.log>
Oct 13 17:01:01 ubuntu-isp sshd[3052]: Invalid user bob from 172.16.241.1
Oct 13 17:01:01 ubuntu-isp sshd[3052]: Failed none for invalid user bob from 172.16.241.1 port 36170 ssh2
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - option verbose is set to "1"
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - option table is set to "users"
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - option usercolumn is set to "name"
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - option passwdcolumn is set to "password"
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - option crypt is set to "0"
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_close_db() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_sm_authenticate() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_open_db() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_open_db() returning 0.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_check_passwd('bob','(null)') called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_format_string() called
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_quick_escape() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - SELECT password FROM users WHERE name = 'bob'
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_check_passwd() returning 6.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_sql_log() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_sql_log() returning 0.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_converse() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_open_db() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_check_passwd('bob','^H ^M INCORRECT') called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_format_string() called
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_quick_escape() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - SELECT password FROM users WHERE name = 'bob'
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_check_passwd() returning 6.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_sql_log() called.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_sql_log() returning 0.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: pam_mysql - pam_sm_authenticate() returning 7.
Oct 13 17:01:02 ubuntu-isp sshd[3052]: Failed password for invalid user bob from 172.16.241.1 port 36170 ssh2
Oct 13 17:01:03 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_release_ctx() called.
Oct 13 17:01:03 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_destroy_ctx() called.
Oct 13 17:01:03 ubuntu-isp sshd[3052]: pam_mysql - pam_mysql_close_db() called.
</auth.log>

How can this be ?

Best
Robert Larsen
robert@komogvind.dk

Discussion

  • Anonymous

    Anonymous - 2010-12-03

    I have absolutely the same problem! Did you solved it?

     
  • Michael Sierks

    Michael Sierks - 2011-01-22

    I have this problem as well, I am unsure why this is happening. I am trying to figure out why the module is unable to get the auth token, but the code looks sound to me. This issue is starting to get on my nerves. Maybe further testing will reveal more answers.

     

Log in to post a comment.