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

Re: Changing UID's?



On Sunday 22 June 2003 00:21, Clive Menzies wrote:
> On (20/06/03 21:36), cr 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 something.
> >
> > 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
> > cr1::500:cr
> > 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?
>
> Have a look at man usermod  and man adduser (group) - It would be worth
> creating a new user on both systems with the same UID and GID and use that
> account to rearrange everything.  Don't forget, if you're using samba, to
> change smbpasswd.
>
> Clive

That was easy!    8)

Thanks!   usermod   was just what I needed.     Edited /etc/group by hand 
then changed UID with usermod.   

My old copy of 'Using Linux' doesn't seem to mention it (or if it does, I 
missed it).

cr



Reply to: