Re: change user id

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

 



On 03/05/2018 06:30 PM, Bill Shirley wrote:
> I've done this many times but always from root.

I've not tried it for this sort of thing, but "sudo bash -l" SHOULD make
a non-root user behave as root (including root's environment).

> With no root account, I would:
> 1) create a 2nd user 'test', set a password, and make 'test' a sudo user
> 2) logout and login as 'test'
> 3) let's say the user to change is 'bob' with id 1000
>   grep bob /etc/passwd
>   should yield:
>     bob:x:1000:1000:Bob:/home/bob:/bin/bash
> 4) edit /etc/passwd and change the 1st number (the uid) for 'bob' from
> 1000 to 54321 and save
> 5) run:
>   sudo find / -xdev -uid 1000 -exec chown bob {} \;
>   -xdev says stay on this filesystem; don't descend into /proc or /sys
> or /cdrom and so on.
>   This could take awhile.
> 6) logout from 'test' and login as 'bob'

Don't forget that many people have /home as a separate filesystem, so
an additional "find /home -xdev -uid 1000 -exec chown bob {} \;"
wouldn't be out of place. Perhaps superfluous, perhaps very necessary.
Couldn't hurt. Belt and suspenders, don't you know.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-   "Do you suffer from long-term memory loss?"  "I don't remember"  -
-                            -- Chumbawumba, "Amnesia" (TubThumping) -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



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

  Powered by Linux