1833265 Members
2932 Online
110051 Solutions
New Discussion

NIS

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

NIS

Hi All,
Getting ready to venture into NIS without much experience. The first thing I am doing is getting all my users on the entire platform, into a file and syncing the id number for each user. Now all users will have the same ID number on each machine. Question is, what command can I use to change a users ID number?
Is there a script I can use?

Thanks,
Bob Menefee
UNIX IS GOOD
4 REPLIES 4
Peter Kloetgen
Esteemed Contributor
Solution

Re: NIS

Hi Robert,

you can use the command:

usermod -u uid username


Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
A. Clay Stephenson
Acclaimed Contributor

Re: NIS

Hi Robert:

The simple answer is to edit the passwd file or use vipw - a safer version of the same thing BUT make sure that you have a backup copy of the passwd file AND that you are logged in as root in at least two sessions. That way you can get yourself out of trouble just as fast as you got yourself in.

Don't overlook the fact that you are also going to need to run a find -exec script to change the ownership of files on all your boxes when you change UID's/GID's.

Regards, Clay
If it ain't broke, I can fix that.
Peter Kloetgen
Esteemed Contributor

Re: NIS

Hi Robert,

You can do the same with a script:

usermod -u $1 $2

usage:

scriptname desired_uid desired_user

of course you can also use SAM instead.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping