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

Re: sharing /home and swap space between two Linux systems

On Mon, 9 Jul 2001, D-Man wrote:

> On Mon, Jul 09, 2001 at 01:46:50AM -0400, Faheem Mitha wrote:

> | The most obvious problem with this is
> | 
> | 1) a) My user id on SuSE is 500. My user id on Debian is 1000. Clearly I
> | will need to reconcile these. I think I would prefer to change my Debian
> | uid to 500. I'm not sure how to do this. I could try editing /etc/passwd
> | my hand, but this might be dangerous.
> After I had read the Debian docs which say UIDs under 1000 are
> reserved for something, I changed my RH UID to 1000 (it defaulted to
> 500 too)

I think I would rather change the Debian uid. Does anyone have good reason
to suppose that the 500 uid might be used by something else in Debian? If
not, I would be inclined to risk it. My SuSE installation is very old (2
yrs) and there is a lot of stuff there. I would rather not fiddle with it.
In any case, can you point me to the Debian doc in question?

Also, would I need to change the gid for group faheem to 500 as well, or
can I leave it at 1000? I don't see why I can't leave it, so I will try
that first.
> | The SuSE /etc/passwd has as my entry
> | 
> | faheem:x:500:100:Faheem Mitha:/home/faheem:/bin/bash
(user faheem, group users)
> | The Debian /etc/passwd has
> | 
> | faheem:x:1000:1000:Faheem Mitha,,,:/home/faheem:/bin/bash
(user faheem, group faheem)

> | I think I would like to change the Debian uid. If I simply change the uid
> | faheem in /etc/passwd from 1000 to 500 then will everything be hunky-dory?
> | Or is there a better way to do this?
> You can simply change the UID/GID in /etc/passwd, but note that all
> files on the system have owner/group stored as an int, not as the
> name.  You will need to change all files that are already owned by the
> "wrong" UID to the right one.

Yes, sorry. Overlooked this obvious point.
> I did this by using linuxconf on RH to remove my user, but keep home
> dir.  Then create user again, but specified UID 1000.  Then I used 'ls
> -lR' to find all files owned by "500" (it displays the UID because
> there is no name associated with it).  Then, as root, I 'chown dman
> <file>'  ('dman' is my user name).  Since my UID is now 1000 it stores
> that in the file.  If you forget something, like in /usr or /var, you
> will find out when you get permission errors.
> Try 
> "ls -lR / | grep 500"
> to get a rough idea of all the files owned by the old UID (that is,
> after changing SuSE to use UID 1000).  This particular usage of the
> commands will display any files that happen to have "500" in the name.

There is a command called usermod which will change the uid and
automatically change all the files in the home directory to conform with
the new uid. Any files outside that will have to be changed manually. But
apart from /var/spool/mail/faheem, I can't think what these would be. This
is a brand new installation. Does anyone know of other files which might
have my uid on them by default?

> Some things don't work well that way, but you could hack your way
> around it with various login scripts (it wouldn't be a pretty sight,
> BTW, but I can give some (untested) suggestions if you really want
> them).


> I don't know how to tell init where to find the swap.  Perhaps
> /etc/inittab tells?

I was thinking of going back into the installation program and telling it
I wanted to use this partition as a swap space after all. Is this
possible? Otherwise, is changing things manually an option?


Reply to: