From: Feng Qiu (
Date: Thu Jan 02 1997 - 08:03:11 CST

Thanks for all answers!!

from: larry d. clark" <>

If you are root, change /etc/passwd, then cd into the directory
where the $HOME is and issue chown -R user_name $HOME.

from: (Steve Ozoa)

You'll also have to fix the ownership of all their files

from: (Michael Sullivan)

Besides /etc/passwd, you will need to change /etc/shadow, and you will
need to change ownership of all the user's directories and files, not
just those under his home directory, but any others that may be
scattered around the file systems, such as /var/mail/user.

from: "K.Ravi" <>

Yes, you have to modify /etc/passwd. Edit it manually or use 'usermod'.
But be
sure to do a 'chown' for all files owned by the user. (cd to user's home
directory, run 'chown -R <newuid> *' . If the user's files are spread in
different places, you might have to do something like this:
# find / -user <olduid> -print |xargs chown <newuid> )

from: Cagri Yucel <>

Change password file. But the files owned by this user will remain
the old UID. This probably will be displayed as a number, make a
chown -R new_uid users_home to solve this problem.

from: si jianwei <>

You can do this job if you have root account.
Please try it .
First you should change to root user. Next, use "usermod" command. For
% su -
# usermod -u 9999 usera
# cd ~/usera; cd ..
# chown -R usera usera

Of course, you can edit /etc/passwd file to change user's id.
But , be warned the user's home directory must be changed with "chown"

from: Tom Powers <>

On the off hand chance you haven't already gotten a hundred replies
to this, here's my suggestion.

Use the command:
        usermod -u NEWUID LOGIN
then run a find to change the ownership
        find / -user OLDUID -print -exec chown NEWUID {} \;

I'm in the process of syncronising a few dozen machines, all of which
have the same users but different UID numbering schemes, so I'm using
this a lot


original message:
> Hello, Happy New Year!!
> If I want change a User's UID, what should I change, passwd file,
> anything else? SPARCStation 5 with solaris2.5.1.
> Thanks!!

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:42 CDT