Choose UID and GID for spamd system user and group

Hi,

I’m currently fiddling with SpamAssassin under Rocky Linux 8. I’ve been successfully running it on my mail servers for the last decade or so. I’ve already done some tests, and it seems to run fine under my favorite server distribution.

One little detail though. Running SpamAssassin requires a dedicated spamd user and group. Until now I’ve created those like this:

# groupadd spamd
# useradd -c "SpamAssassin User" -g spamd -s /bin/false -d /var/log/spamassassin spamd

But this creates the spamd user and group with a UID and GID > 1000, like my normal users.

I’d like to choose a UID and GID < 1000 which seems more appropriate to a system user and group, but I’m not sure how to choose it.

Back in the days when I used Slackware Linux on my servers, there was a nice little document (it still exists here) that informed the user about possible UID and GID pairs for system users.

Is there something similar for RHEL & clones ? I want to make sure that if I choose a UID and GID < 1000 for spamd, this will not create a potential conflict with some other system user and group needed by a different piece of software.

Cheers,

Niki

See man groupadd and man useradd for option --system. The /etc/login.defs mentioned there has some comments too.
(The commands do have options --gid and --uid too, respectively, but they require unique parameter.)


I’ve encountered the /etc/login.defs for SUB_[GU]ID_* – for user namespaces that id mapping between host and containers is based on.

1 Like