Operating System - HP-UX
1833780 Members
2458 Online
110063 Solutions
New Discussion

Re: Quesions about two files in NIS

 
Andrew Kaplan
Super Advisor

Quesions about two files in NIS

I had two questions:
1. The /etc/hosts file on the slave server does not match that of which is on the master. Can I simply copy the file that is on the master to the slave, or is there a better method?

2. The /etc/passwd file on the slave server does not match that of which is on the master. The file on the master does not have the ending + sign, while that on the slave does have it. Is that by design, or should the two be the same? Thanks.

The two servers are part of a ServiceGuard cluster, and both are running HP-UX 11i version 1.
A Journey In The Quest Of Knowledge
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: Quesions about two files in NIS

I assume that /etc/hosts and /etc/passwd on the NIS master server are the source files for the hosts and passwd NIS maps respectively. If so, it is perfectly normal and expected that these files be different. In fact, if they were identical, what would be the purpose of NIS. The NIS master transfers the maps rather than the source files to the slave servers. The '+' entries are used as a template to fill out a passwd entry for any entries that have not been locally matched --- meaning that the passwd data are supplied by the NIS passwd map entry. Suppose that you have a user 'mickey' that is defined in NIS and locally and another user 'donald' that is only defined in NIS. When a user logs in as mickey, a local passwd entry is found and that is used in preference to his NIS entry. 'donald', on the other hand, is not defined locally so the '+' entry tells the client how to fill out his passwd entry using the NIS yppasswd map.
If it ain't broke, I can fix that.
V. Nyga
Honored Contributor

Re: Quesions about two files in NIS

Hi,

if you want to have a real NIS client, your hosts should have
' ' of the client,
'127.0.0.1 localhost loopback' and a '+' at the end.
So the rest is delivered from the NIS server.
For your passwd you need the local users remain, all NIS users are delivered from the server.
For a 11i client there are the pre-installed users:
root, daemon, bin, sys, adm, uucp, lp, nuucp, hpdb, nobody, www, smbnull, iwww, owww
and a '+' at the end.

When you change the NIS files at the server, you have to push the maps with the command '/var/yp/ypmake'.
So the 'maps' of the clients are up-to-date again.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Peter Nikitka
Honored Contributor

Re: Quesions about two files in NIS

Hi,

the mode of operation between NIS and local files is done through /etc/nsswitch.conf :
fgrep passwd: /etc/nsswitch.conf
passwd: files nis

The above setting tells the name resolver to look first into the local /etc/passwd and, if nothing matches, proceed with the NIS map.

The +entry mentioned by the other posters is only required when
passwd: compat

is used.


mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"