LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cmpat mode in nsswitch.conf (https://www.linuxquestions.org/questions/linux-newbie-8/cmpat-mode-in-nsswitch-conf-4175455655/)

Rohit_4739 03-26-2013 09:10 AM

cmpat mode in nsswitch.conf
 
Hi All,

Can anyone give me exact insight on as to what does compat mode means and is used for in /etc/nsswitch.conf. This is what i know about it

Quote:

You can put special codes in the /etc/passwd, /etc/group, and /etc/shadow files that cause the system, when you specify the compat method in nsswitch.conf, to combine and modify entries in the local files and the NIS maps. That is, a plus sign (+) at the beginning of a line in one of these files adds NIS information; a minus sign (–) removes information.
Secondly recently i faced an issue where an ssh was being denied for a particular user and user was coming from ldap. When i used getent to reterieve user details it was shwoing the correct but ssh was failing.

The nsswitch.conf entry for passwd was like this

Code:

passwd: files vas4 ldap
User was coming from ldap but authentication was failing, then i added an entry like below in /etc/passwd and everything started working

Code:

+testuser
It worked but i was not able to understand how and i am still confused, so anyone please explain about it. It was on RHEL 5.6.

Please do ask for more information if the issue is not clear to you, i would try to explain more.

shivaa 03-27-2013 01:53 AM

Code:

passwd: files vas4 ldap
It means, for users authentication, your system will first check for system's local passwd file i.e. /etc/passwd, then vas4 and then ldap. So in order to authenticate user from ldap, make it like:

Code:

passwd: ldap files vas4

Rohit_4739 03-28-2013 01:04 AM

Quote:

It means, for users authentication, your system will first check for system's local passwd file i.e. /etc/passwd, then vas4 and then ldap. So in order to authenticate user from ldap, make it like:

Thanks but i already know what you just told me. My question was regarding COmpat mode and how making an entry "+testuser" made the things work. I would request you to read the question little more carefully.


All times are GMT -5. The time now is 03:25 PM.