Re: change uid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-01-19 at 10:23 +1100, Yuandan Zhang wrote:
> 
> 
> On 19/01/07, Rick Stevens <rstevens@xxxxxxxxxxxxxxx> wrote:
>         On Fri, 2007-01-19 at 08:32 +1100, Yuandan Zhang wrote:
>         >
>         >
>         > On 19/01/07, Yuandan Zhang <yuandan.zhang@xxxxxxxxx> wrote:
>         >         Hi,
>         >
>         >         I need to change a uid on  a client PC in order to
>         access nfs
>         >         of a server. The uid at local client is 500, that is
>         3000 on
>         >         the server. How to change it?
>         >
>         >         I googled and found niutil can do it, but it seems
>         works  on 
>         >         Mac OS. Is there equivalent tool on linux?
>         
>         As root, run "usermod -u 3000 name-of-user"
> 
> Thanks, that works. one more thing,  in order to login gnome desktop,
> the temp files at /tmp  related to this user must be remove 

Well, actually any files OUTSIDE the user's home directory must be
"chowned" to the new UID (and that includes the /tmp files).  When you
do such things as changing a user's UID, you should scan through the
filesystem(s) and change the ownership of the files owned by the user in
question.  A command that'd do that would be (again, as the root user):

	find / -u 500 -exec chown 3000 \{\} \;

with the "500" representing the users OLD UID, and "3000" representing
the user's NEW UID.  The "usermod" command will take care of the user's
home directory and anything under it, so run the find command after
doing the usermod command.  The user's home directory and such will
already be owned by the new UID, so the find command won't modify them
again.

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens@xxxxxxxxxxxxxxx -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-    Overweight:  When you step on your dog's tail...and it dies.    - 
----------------------------------------------------------------------

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux