Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am not able to authenticate and authorize users present in my mysql database. If someone can point out where I am wrong it would be very helpful.Following are the steps that I followed.

  1. Firstly I created a databse and added users to that database giving each user a corresponding password.

  2. Then I created two classes of users -: nss(privileged viewing rights) and nss-shadow(privileged writing rights) and assigned them ieopurASDF and ruASDFDER as password respectively.

  3. I changed the /etc/nssswitch.config file to

    passwd: compat mysql

    group: compat mysql

    shadow: compat mysql

  4. Now I edited the files /etc/nss-mysql.conf and /etc/nss-mysql-root.conf to include the classes nss and nss-shadow as usernames and passwords that I assigned in step 2).

  5. I then made some changes in files belonging to /etc/pam.d which are as follows:

    Made "common-auth" look like this

    auth sufficient pam_unix.so nullok_secure auth required pam_mysql.so user=nss-shadow \ passwd=ruASDFDER db=nss_mysql usercolumn=user.user_name \ crypt=1

    Made "common-account" look like this

    account sufficient pam_unix.so account required pam_mysql.so user=nss \ passwd=ieopurASDF db=nss_mysql usercolumn=user.user_name Made "common-session" look like this

    session sufficient pam_unix.so session required pam_mysql.so user=nss \ passwd=ieopurASDF db=nss_mysql usercolumn=user.user_name

    Made "common-password" look like this

    password sufficient pam_unix.so nullok obscure min=5 max=12 md5 password required pam_mysql.so nullok user=nss-shadow \ passwd=ruASDFDER db=nss_mysql usercolumn=user.user_name \ crypt=1 md5

share|improve this question
    
What do you have in /etc/libnss-mysql.cfg? I guess you need to tell it how to query the database at some point. –  John Mee May 23 at 5:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.