1829595 Members
1976 Online
109992 Solutions
New Discussion

NIS configuration

 
SOLVED
Go to solution
Vipin Singhal
Super Advisor

NIS configuration

My server is using NIS. I’m not sure, but I believe all of the users are already in NIS. Is there a way to validate this?
Thanks
Vipin
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: NIS configuration

Shalom Vipin,

ypwhich

ypmake

Thats a start.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: NIS configuration

ypcat passwd
If it ain't broke, I can fix that.
Devender Khatana
Honored Contributor
Solution

Re: NIS configuration

Hi Vipin,

Check the entries in the /etc/nsswitch.conf file.

#cat /etc/nsswitch.conf
passwd: files nis
group: files nis
hosts: nis [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: files nis

The output should be similar to this.

HTH,
Devender
Impossible itself mentions "I m possible"
Rick Garland
Honored Contributor

Re: NIS configuration

The ypwhich and ypcat commands are the commands to will need to validate this.

The ypwhich command will tell you what NIS server (master or slave) the client is binding to.

The ypcat command will list the accounts in NIS. This could be 'ypcat yppasswd' or 'ypcat passwd' or something else. You will will to verify this for your environment since this name can be specified.

If you have a server that is not in NIS (as validated by the ypwhich) then check the local passwd file.

Raj D.
Honored Contributor

Re: NIS configuration


Hi Vipin ,

Here is a good doc for NIS also having interoperability with aix.

http://www.freelab.net/unix/hp-ux/chap11_nis.html

hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Vipin Singhal
Super Advisor

Re: NIS configuration

root@server:[/root]# ypwhich
stock.companyname.com
root@server:[/root]# cd
root@server:[/root]# cat /etc/nsswitch.conf
#
# /etc/nsswitch.conf

passwd: files [NOTFOUND=continue] nis
group: files [NOTFOUND=continue] nis
hosts: files [NOTFOUND=continue] nis [NOTFOUND=continue UNAVAIL=continue] dns
networks: files [NOTFOUND=continue] nis
protocols: files [NOTFOUND=continue] nis
rpc: files [NOTFOUND=continue] nis
publickey: files [NOTFOUND=continue] nis
netgroup: nis [NOTFOUND=continue] files
automount: nis [NOTFOUND=continue] files
aliases: nis [NOTFOUND=continue] files
services: files [NOTFOUND=continue] nis
root@server:[/root]# ypcat passwd | more | grep vipin
vipin:XI8op1IoKNZXc,B.CR:18058:106:john gins:/ahome/vipin:/usr/bin/ksh

Thanks for your support.
how will i create the new users in the same group?
How will i select their home directory?
how will i define their group?
Please suggest
vipin

A. Clay Stephenson
Acclaimed Contributor

Re: NIS configuration

Q. how will i create the new users in the same group?
A. I don't know how you would do it but I would give them a common group ID.

Q. How will i select their home directory?
A. I don't know how you would do it. It is common in an NIS environment to automount home directories so that the user has the same home directory regardless of the machine he is currently working on.

Q. how will i define their group?
A. I don't know how you will define their group. I would make an entry in the group map and then when you create the passwd entry give them this group ID.

Once again, you don't seem too interested in learning on your own. Get yourself a copy of
O'reilly's "Managing NFS and NIS"; it's an excellent reference and will deal with all of your questions.


http://www.oreilly.com/catalog/nfs2/index.html
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: NIS configuration

You create users in the same group by using options in the useradd -G command.

Some people build a standard user template, put it in /etc/skel and that keeps all users in the same group.

In an NIS environment users should be created on the NIS Master. ypmake pushes them to the NIS slaves.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rick Garland
Honored Contributor

Re: NIS configuration

The latest questions you have cannot be answered with confidence because there can be numerous methods of accomplishing this task - and all achieve the same result.

Does your environment modify the NIS passwd file directly? Or do you use the adduser utility?

This is one example.

Either method can work but this depends on the environment.

SAM would be the 1st place to look.