Pages

Thursday, May 1, 2008

Adding New NIS users

New NIS users can be created by logging into the NIS server and creating
the new user account. In this case, you'll create a user account called
nisuser and give it a new password.

Once this is complete, you then have to update the NIS domain's
authentication files by executing the make command in the /var/yp
directory.

This procedure makes all NIS-enabled, nonprivileged accounts become
automatically accessible via NIS, not just newly created ones. It also
exports all the user's characteristics stored in the /etc/passwd and
/etc/group files, such as the login shell, the user's group, and home
directory.

[root@by]# useradd -g users nisuser
[root@by]# passwd nisuser
Changing password for user nisuser.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@by]# cd /var/yp
[root@by]# make
[root@by]#

You can check to see if the user's authentication information has been
updated by using the ypmatch command, which should return the user's
encrypted password string.

[root@by]# ypmatch nisuser passwd
nisuser:$1$d6E2i79Q$wp3Eo0Qw9nFD/::604:1100::/home/nisuser:/bin/sbash


You can also use the getent command, which has similar syntax. Unlike
ypmatch, getent doesn't provide an encrypted password when run on an NIS
server, it just provides the user's entry in the /etc/passwd file. On a
NIS client, the results are identical with both showing the encrypted
password.

[root@by]# getent passwd nisuser
nisuser:x:604:1100::/home/nisuser:/bin/bash
[root@by]#

No comments: