Apologies for the double-posting. My idiocy with this webmail--
interface :)
Post by John Edwards<snip>
Post by John EdwardsB) Change your UID from 500 to 1001 (assuming that it UID is not
used), and probably also your GID as well. Likely to be safer in the
long term, but carries a small amount of risk to it.
1) Make sure that you can login to the text console as the root user.
2) Logout of everything as your normal user.
3) As root run 'usermod -u 1001 <your_username>'
4) As root run 'groupmod -u 1001 <your_username>'
'groupmod -g 1001 <your_username>'
This is assuming that RedHat/Fedora still creates a group for every
user with the GID equal to the UID.
They do.
Post by John EdwardsPost by John Edwards5) As root run 'find / -uid -exec 501 chown 1001 "{}" \;'
find / -uid 501 -exec chown 1001 "{}" \;
Post by John Edwards6) As root run 'find / -gid -exec 501 chgrp 1001 "{}" \;'
find / -gid 501 -exec chgrp 1001 "{}" \;
Post by John Edwards7) Log back in as your normal user.
8) Realise that you shouldn't trust code sent via the Internet.
:)
Indeed. Lookup the commands and check that the options do what we
claim.
RTFM as the old adage goes.
Post by John Edwardsps. If you have a lot of files then the 'find' commands will take a
long time, because chown/chgrp is called separately for every file.
This might be speeded up by piping the list of files to xargs with
find / -gid 501 -print0 | xargs -r0 chgrp 1001
But I sometimes meet problems with files with special characters in
them when doing this, usually created by Windows clients via Samba.
A few notes on the (very sensible) procedure outlined above:
At first, I would probably only concern myself with /home/$username,
/tmp and /var/tmp
as those are the only parts of the filesystem to which non-privileged
users have write access by default.
That would enable you to login as the newly modified user account and
then use sudo or su to fix anything else.
Also, at no point does the advice cover changing the primary GID of
your user to 1001, which would also be required.
so you could just do (as root)
1. groupmod -g 1001 yourusername
(the group first, otherwise the following would probably complain that
there is no group with gid 1001)
2. usermod -a -G 500 -u 1001 -g 1001 yourusername
(this also adds your new user to the primary group of the old one -
this should allow access to
any files that haven't been converted by the rest of the commands. You
do end up with an orphaned group though.)
4. find /tmp /var/tmp /home -uid 500 -print0 | xargs -r0 chown -v
username:
(the trailing : automatically uses the new user's primary group. If you
don't want that, don't use it. :) )
5. find /tmp /var/tmp /home -gid 500 -print0 | xargs -r0 chgrp -v
newusername
6. logout of the root terminal and (probably, to be sure there are no
sessions lying about with the old UID/GID) reboot.
7. login after the reboot, which should work just fine. if not, login
as root on the terminal and work out why :)
Then if you want to check the entire filesystem, you can do it in a
graphical terminal while doing other things.
Stuart
(waiting for the mistakes that he has inevitably made to be pointed
out)
--
Stuart Sears RHCA etc.
"It's today!" said Piglet.
"My favourite day," said Pooh.
--
Gllug mailing list - ***@gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug