Around 01:35am on Tuesday, January 24, 2012 (UK time), Timothy Murphy scrawled: > Michael Hennebry wrote: > > >> The new lower limit of 1000 for normal user and group IDs is another > >> issue. The current user has IDs 500 and has rather > >> a lot of files that I want to keep. > >> Fedora's documentation says to use a kickstart file to keep 500. > > > > How? > > If it's documented anywhere, I can't find it. > > From what I've read, %post won't work. > > IDs from the 500-999 range will already have been allocated. > > 'Tain't obvious that %pre would work either. > > If %pre runs before everything else, /etc won't exist yet. > > I'm in a similar situation, where I have UID 1000 on my Fedora laptop, > and 500 on the CentOS server. > I'm wondering if there is any simple way of changing my CentOS ID to 1000? > > I'm thinking of setting up a new CentOS user with ID 1000, > moving all my files to the new user, > removing my old user entry, > and finally changing the username of the new user back to me. I did something very similar to this, although I chnaged the UID of my CentOS user, rather than create then rename a new user. This has worked fine. The following is copied from my changelog and shows what I did. Note steve is my user on the CentOS box, which NFS exports certain directories to my Fedora workstations. Steve 22/11/11 With Fedora 16 the UID and GID allocation for user accounts start from a value of 1000, instead of 500. To keep these synchronised between quail and the Fedora workstations, /etc/login.defs needs to be changed to reflect this new policy. # cd /etc # cp login.defs login.defs.old # vim login.defs ... # diff login.defs login.defs.old 25c25 < UID_MIN 1000 --- > UID_MIN 500 31c31 < GID_MIN 1000 --- > GID_MIN 500 The UID and GID for steve needs to be changed from 500 to 1000. This can't be done while anyone is logged in as steve, so I logged out of the system monitoring console and created a new user, mrcursor, to login as before using su to change to root. This was created as UID 1001 as I wanted to reserve 1000 for steve. # useradd -u 1001 mrcursor # passwd mrcursor ... Allow remote logon. # cd /home/mrcursor # cp /home/steve/.ssh/ . # chown -R mrcursor:mrcursor .ssh Now log in as mrcursor. Ensure there GID 1000 and UID 1000 don't exist. # grep 1000 /etc/group # grep 1000 /etc/passwd Show passwd and group entries for steve. # grep steve /etc/passwd steve:x:500:500::/home/steve:/bin/bash # grep steve /etc/group steve:x:500: webeditors:x:503:steve,champs,lackey img:x:506:steve,lackey Change GID and UID. # groupmod -g 1000 steve # usermod -g 1000 -u 1000 steve Show passwd and group entries for steve. # grep steve /etc/passwd steve:x:1000:1000::/home/steve:/bin/bash # grep steve /etc/group steve:x:1000: webeditors:x:503:steve,champs,lackey img:x:506:steve,lackey The ownership of any files in my home directory were changed by the usermod command. But other files had to have their ownership changed manually. The find command can be used to identify these. find / -user 500 -print ... find / -user group -print ... Files in /var/tmp were ignored. To change ownership: # chown -R --from 500:500 steve:steve /var/www # chown -R --from 500 steve /var/www # chown -R --from 500 steve /img # chown -R --from=500 steve /etc # chown -R --from=500 steve /var/spool/cron # chown -R --from=:500 :steve /img # chown -R --from=:500 :steve /etc Similarly change the webeditors group to have GUID 1004 instead of 503. # groupmod -g 1004 webeditors # chown -R --from=:503 :webeditors /var/www -- Website: www.stevesearle.com Twitter: @ReddishShift Facebook: www.facebook.com/steve.searle 12:00:23 up 12 days, 10 min, 1 user, load average: 0.01, 0.03, 0.00
Attachment:
pgpVYKX72l21O.pgp
Description: PGP signature
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org