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.
Firstly I created a databse and added users to that database giving each user a corresponding password.
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.
I changed the /etc/nssswitch.config file to
passwd: compat mysql
group: compat mysql
shadow: compat mysql
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).
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_nameMade "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