Changing the UID number of a directory

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Jan 18 21:20:04 UTC 2012


On Wed, Jan 18, 2012 at 03:02:44PM -0500, William Muriithi wrote:
> I have two users with the same name, and I got them because I
> configured the system to use LDAP after I had already created a local
> account and generated files on the home directory.
> 
> In another word, I have two account both called william, but one with
> a UID of 501 and another with a UID 2005.  When I check the file
> properties of the home directory with "ls -n /home/ | grep william",
> they are owned by UID 501, so despite login with the same account
> "william", I get permission denied because of the inconsistent UID.
> 
> I have checked chown and it does not have a way of changing UID when
> both account has a name "william".  Is there a way of changing this
> properties without destroying and starting a fresh?  I have looked at
> all the flags for chown and nothing seem to allow that.

find with -uid 501 -exec chown 2005 \; should work.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list