Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NIS question 2

Status
Not open for further replies.

sm42

Technical User
Dec 11, 2003
133
GB
Hello

I have used NIS in a few environments and set-up nis clients.

How does NIS determine which map to use, when a client requests?
maybe a system call??
how does NIS know whether to user hosts map or the ethers map ?

thanks

 
isn't it the /etc/nsswitch.conf.

cp /etc/nsswitch.nis /etc/nsswitch.conf

If you have in the /etc/nsswitch.conf something like this, then it will use nis first since it is stated first, if nis fails it should attempt to use local files.

passwd: nis files
group: nis files


that is if I understand your question correctly...




 
nsswitch.conf is NOT what I'm looking for

that's the order in which place to resolve name services

How does NIS know which NIS maps to use?
there can be say more than 15 NIS maps, how does NIS know which map to consult in order to get the answer


thanks
 
seen that article and have googled to no success

 
Then I don't understand the question, because the article states that the ypserv daemon handles client requests for nis maps.
It also states that nicknames are used to describe actual references to nis maps, ypcat -x tells you this.

As an example `ypmatch <user> passwd`, tells nis to look in the passwd map, which is a nickname for passwd.byname.

 
agreed, with regards to your example
and that ypserv handles NIS requests

how about when you dont tell NIS which maps to use
e.g ssh host1
or
NIS will look at hosts and netgroups
but how does NIS know this ?
 
aplogies if I caused any confusion
 
Well if a program is asking for an ip-adress then the system are using gethostbyname() and that function knows that it should use hosts maps.

And for example when you using passwd to change/set password for a user, the program use getpwname()/setpwnam() function and these functions knows att it should use passwd maps.

The same for the rest of the maps, the functions in the system knows what maps to ask for.
 
gunnard,
thanks for that,that will do, the system call should determine which nis map nis will use


nice one
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top