Re: Changing UID's?
In linux.debian.user, you wrote:
> I'm 'cr', UID 1000 in my Debian setup. However, under RedHat I was
> UID 500 and all my heaps of data (left over from RedHat) is filed as owner
> 500 group 500. This means I can't readily access it without changing
> I could, of course, chown the whole lot to cr:cr (i.e. 1000:1000 in
> this Debian system) but that means if I ever crash this installation and have
> to put my RedHat disk back I'll have to change it all back again, so I'm a
> little reluctant to do that (and also, I'm nervous about changing ownerships
> on entire directory trees....)
> For now, I've given myself access by adding a line in /etc/group
> which as I understand it makes Debian think all the files with UID/GID of
> 500:500 belong to a group 'cr1' and I, 'cr', am a member of that group.
> (It doesn't work on any files copied from the old RH /home/cr/ which have
> 'owner' permissions only, unless I su root or change permissions, but those
> are just backups so I can live with that).
> However, it would be more sensible I think if I was User 500 in both
> systems. Is there any safe legal way to change my UID from 1000 to 500?
> Or, failing that, can I do it by using 'adduser' to create a new user, say
> 'cr2', as user 500, then when I've got 'cr2' properly set up and everything
> works, delete user 'cr' (with UID 1000) and rename user 'cr2' to 'cr'.
> And, more importantly, are there any hidden snags in any of the above which
> will crash my whole system or lock me out of it?
I usually do this when I first install a new distro and before I mount my
regular /home partition.
adduser --uid 500 ajlewis2
After I have made the user and have the /home/ajlewis2 directory I edit
fstab so that my /home partition will be mounted on the next reboot and then
do 'mount /home' Now I have all my personal files in /home/ajlewis2 and my
uid on the new distro is 500 like it was on the old distro. I came from
RedHat a few years ago and am still using that original /home partition. I
have shared it between distros a couple of times and had a few configuration
files overwritten; so be careful if you do that.
If you make this change after you have a bunch of files already on your
debian user directory, then you will have to deal with changing those, but
since it is a new install that should be minimal.