Web lists-archives.com

Re: System user names, uids, and gids

Steve Keller wrote:
> Debian uses some long (more than 8 chars) user and group names which I
> don't particularly like, e.g.
> [...]
> This is annoying with ps(1) which abbreviates these names.  For more
> than 20 years I have always limited user names to 8 chars on all my
> Unix and Unix-like systems.  Can I rename Debian's user names without
> problems or will they be re-created by apt the next time I install or
> upgrade an affected package?

You'll have to find programs running under these usernames, and likely
edit some config files so that they can find the correct username next
time they're started.

However, that's about the worst you'll have to deal with -- the
underlying system mainly cares about the UID rather than the text string
("name") associated with that ID.

NOTE -- I don't do systemd, so I can't comment on how well (or not) it
will actually support your attempts to tell it to run with a different

> Also, I wonder why I have user names like Debian-exim in my
> /etc/passwd although I haven't installed exim.  It was part of the
> initial install but I have removed it afterwards.  Shouldn't the
> package management remove those user entries, too?  May I remove it by
> hand?

No, package management doesn't touch usernames.  They're kept as a
reference so that when you look at a logfile (etc.) that's still owned
by that UID, you'll get the username instead of just an ID number.

Granted, if nothing is owned by debian-exim anymore, then deleting the
entry will not cause any problems.

> Next, there are many names which are both, a user name and a group
> name.  However, I don't like that many of these don't have the same
> numeric uid and gid.  Are these IDs fixed in Debian or may I renumber
> them to my liking?

This gets messy, since the ID number is what matters to the system.
Changing *that* information may very well break things.  It's completely
fixable (i.e. change /etc/group and then find all the files group-owned
by the old GID, and update the ownership).

If anything, this is the one thing I wouldn't touch on a system, unless
I was building it from scratch (e.g. LFS) -- a better approach to the
GID/UID mismatch would perhaps be talking to the package maintainers.

|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281