>>> On Fri, 13 Jun 2003 19:34:35 -0400, Technoslick <[EMAIL PROTECTED]> said:

 t> I've been looking for an answer to a question, but haven't seen anything
 t> that helps me understand what to do...

 t> I'm running a mixture of RedHat and Mandrake machines in a Samba
 t> supported network. Too late, I learned that the two distro's do not
 t> default to the same starting number when first creating a user. Since I
 t> am the only user, I have two UID's and its causing me connectivity
 t> problems between the two distro's and Samba.

 t> I need to change the user UID from 500 to 501. From my research it
 t> "appears" I may lose ownership, and/or home settings for that user. I
 t> want to avoid this. 

 t> How difficult is it and what steps need to be taken to successfully
 t> change a user's UID while preserving his home and its contents as owner?
 t> Is this something a newbie to Linux should be able to do? Any pointers
 t> to URL's that tell it as it is are *highly* welcomed. I especially am
 t> interested in cautions and real-life issues that I might not see in the
 t> information I have scanned so far.


"find" is your friend. :)

The "find" command will do what you want to do. 

First, just to make sure you're only going to affect the files you
really want to change, run this command:

        find / -uid 500 -ls

That will give you a "ls -l" like listing of all the files owned by
the user with UID 500. If the list seems reasonable, then change the
UID of your user (by editing /etc/passwd or whatever means works best
for you). Then run the following command: (<username> is the login id
of your login account)

        find / -uid 500 -exec chown <username> {} \;

When the find command runs, it will run the chown (change owner)
command on each file that it finds, it will replace the "{}" with the
file name. Don't forget the "\;" that is important as well.

If the listing that you got with the original command isn't what you
were expecting, you might need to tweak the arguments to find. Do a
"man find" for a complete description of what find can do for you.

Johnie


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to