Michael Satterwhite wrote:
<> Does anyone know a way to (a) change the UID of my existing user and (b) globally change the UID of the files created by my user under 9.1. This needs to be done selectively ... if the file is owned by UID 1000, then it needs to be changed to UID 500.
Anyone know how to do this?
Maybe I am misunderstanding the question, but it seems like you want to 1)
edit /etc/passwd as root. Find your login which should have the UID of
1000 beside it. Change it to 500.
Then, as root, cd to /home/<yourlogin>, then "chown -R yourlogin ."
For any other files on the system the slower and more general way of
changing the uid would be to use find (as root):
# find / -uid 1000 -exec chown <yourlogin> {} \;
or looks like new chown has a builtin test ability, so in /etc/passwd,
change your duplicate the line containing your login, change the 1st line
to use 500 instead of 1000, then add "old-" as a prefix in front of the
login name on the 2nd line.
Then you should have "loginname" 's uid equal to 500 and "old-loginname"
's uid equal to 1000.
Then, as root:
# chown -R --from=old-loginname loginname /
There are other ways to accomplish the same, the chown method looks like
it would be the most efficient. You can change groupnames the same way if
you need to.
Also, if you really want to change normal "user id's" back to starting
from 500, look at the file /etc/login.defs. You will see two lines you
likely need to change: one starting with "SYSTEM_UID_MAX", and "UID_MIN".
The comments in the file are explanatory as to their function.
Really, such minor changes in UID's are trival to fix. Revamping a named
(bind) server to be chroot'ed is a far more ugly "upgrade" (though
thoroughly a good idea in terms of security). But the auto-upgrade
process left _much_ (namely functionality) to be desired.
I'm a bit afraid to upgrade to 9.1...guess I need to make sure it doesn't
touch my kernel as I'm already running 2.6.7. The upgrade to 9.0 also
downgraded my squid version from 3.0 down to 2.x (which caused it to break
since the config files are not compatible).