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

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



On Mon, Jul 09, 2001 at 02:59:59PM -0400, Faheem Mitha wrote:
| 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

It's up to you.  If so, then simply s/RH/Debian/ and s/Debian/RH/ in
the telling of my experience with this.  Also s/RH/SuSE/ for you ;-).

| 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?

http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-users.html

It says 

UIDs 100-999 are for system users which have not been allocated by the
Debian project.

and

UIDs 1000-29999 are normal user accounts.

| 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.

You could leave it, but I recommend making them the same.

| > | 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

Nice.

| 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?

On my system (RH) I had some stuff under /var/ftpd/pub/dman and I had
stuff under RH's build directory (/usr/src/redhat/RPM or something
like that).  Nothing terribly significant.

| > 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).
| 
| Sure...
| 
| > 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? 

If you want to re-install ... after all, that's what the installer is
for :-).

| Otherwise, is changing things manually an option?

I'm sure it is -- what isn't on a Linux system?  I just don't know
_how_ to change it ;-).

-D



Reply to: