You are not logged in.

#1 2008-07-21 01:06:55

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

OK to change the symbolic<->numeric user and group mappings? [SOLVED]

I'm transitioning into Arch after using Xubuntu for a year plus. Since I'm still (at least conceptually) in between distros, and expecting to be there for a while, I often find myself diffing or copying files between the two installations. Mostly stuff in /etc. I try not to do this too blindly. One way to slip up is that the numeric ids for users and groups are different on the different installations. Of course, [X]Ubuntu has groups that Arch doesn't; and vice versa. But even where they have corresponding groups, often the numeric ids will be different.

For example, on Xubuntu, daemon=1 and bin=2. On my Arch install, daemon=2 and bin=1. I don't have these installations running on two computers; but just on two partitions mounted on the same computer. So when I'm booted into Arch, and look at the Xubuntu partition, I'll see things showing up under funny groups. Sometimes it's obvious what's going on; but I keep thinking it'll catch me up.

So here's what I'm thinking to do. I've whipped up a Python script to walk through my Xubuntu file tree and change user and groupids so as to correspond more closely to what I've got in Arch. Then I'd adjust the symbolic<->numeric mappings in the Xubuntu /etc/{passwd,group} files. This has to be done carefully: sometimes the desired ending id won't yet be available, and it'd be safest to change to an intermediate id first (in case my tree-walking script crashes and needs to be run again). I understand the pitfalls here, and how to prepare for them.

Here's what I'm not sure about:

Q1. If I do carefully change all the numeric ids on a (non-running) installation, and change the /etc/{passwd,group} files to match, will everything then be good? Or might there be hard-coded numeric ids hidden away somewhere?

Q2. What numbers are reserved? I know that root must be id 0. Are there any other requirements like that? Any distro-specific requirements, where Arch might have made some choices and [X]Ubuntu another? One difference seems to be that on Arch, system ids are <100, whereas on Ubuntu, system ids are <1000?

Q3. I know that different distros won't make exactly the same choices about which groups to have, or what role to assign them. But I'm guessing that groups with the same name can be expected to correspond, and that the following groups also (at least roughly) coincide?
  hal on Arch, haldaemon on Xubuntu
  http on Arch, www-data on Xubuntu (they have the same numeric id on my systems)
  locate on Arch, mlocate on Xubuntu
  log on Arch, syslog on Xubuntu
  network on Arch, netdev on Xubuntu
  optical on Arch, cdrom on Xubuntu
  smmsp on Arch---> does this mean has the authority to use sendmail (or whatever you've got acting as sendmail)? Then what is the role of group "mail"?

Q4. Can anyone explain to me the difference between:

adm, admin. wheel--->Arch has #1 and #3, Xubuntu has #1 and #2, back when I used a Mac I think all three existed. Are admin and wheel basically the same? I.e., they're the group you'd give sudo privileges to? What then is the function of adm?

users, staff--->Arch has #1, Xubuntu has both (but gives the role of a user's primary group to yet a third group, named the same as the user). Are these basically the same?

Thanks for any advice. If I collect enough useful responses, I'll add it to the wiki. Searching has only turned up a little bit of useful info about this (but lots of questions).

Last edited by Profjim (2008-07-21 19:18:02)

Offline

#2 2008-07-21 02:37:55

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: OK to change the symbolic<->numeric user and group mappings? [SOLVED]

This page <http://www.debianhelp.co.uk/usersid.htm> seems to suggest that it'd be bad to change the ids around in the way I'm envisaging. Not that there's anything wrong with the simple act of changing the mapping between symbol<->numeric id; but rather that Debian (and I'm guessing Ubuntu as well) want ids 0-100 to be specific things.

Offline

#3 2008-07-21 19:17:19

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: OK to change the symbolic<->numeric user and group mappings? [SOLVED]

On reflection, it seems much easier/safer to do something like this instead...

When running in Arch, but viewing a partition with another installation's data on it, do directory listings like this:

ls -l | FILTER

where FILTER is a script that pulls out the Arch-announced users and groups, converts them to numeric if necessary (according to Arch's understanding), and then stuffs back in what the other installation thinks are the symbols corresponding to those numbers. This was easy enough to do, and doesn't risk breaking anything.

Marking as SOLVED, but I'd still welcome feedback about the different ways different distributions understand the groups I cited. It's very hard to track this info down.

Offline

Board footer

Powered by FluxBB