How to create users in NIS

How to create users in NIS server in solaris

Thanks in Advance

Example:
nisaddcred -p <uid> -P <username>.<domainname> local
nisaddcred -p unix.<uid>@<domainname> -P <username>.<domainname> des

This nisaddcred command is for NIS+.

If your mean the good old NIS (yellow pages), user accounts are created by populating the NIS password file and running make while being in the /var/yp directory.

Yes, you're right, its for NIS+.
Can show us an example on the command-line then? :cool:

Sure.
Assuming:

  • you use the default configuration with which the regular files are used as source
  • the NIS server is also the NFS home directory server
    Creating a new NIS user would be done with something like this:
useradd -b /export/home -c "silly comment" -s /bin/ksh -m incredible
usermod -d /home/incredible incredible
passwd incredible
cd /var/yp
/usr/ccs/bin/make

Hi jilliagre

I have added a user called "test"in NIS Server and rebuilt the maps too(By running the make passwd command).But while trying to login from a client,i am unable to. Should i need to do anything more.

The ypcat passwd command in the client displays the user "test".

Really baffled...Please help.

jilliagre - trying not to step on your toes, but to get answer to efunds.

Does the client you are attempting to connect to use nis groups as well?
Check for the instance of any +@<group> at the end of the passwd file on the local client.
If there is an entry, +@staff, for instance, then the user would need to be part of that NIS group as well in order to log in.
If not, change user passwd with the yppasswd or passwd -r nis for the user to ensure the passwd map is up to date.
Would be helpful if you posted the output of the attempted log in to see what error is being presented at login time.