Home‎ > ‎

adduser: The --group, --ingroup, and --gid options are mutually exclusive.

posted May 5, 2018, 11:27 AM by Allen Gattis
You may go to create a service account with a known UID and GID like so:

sudo adduser --system --no-create-home --disabled-login --uid 112 --group --gid 117 some-service

However, that command can't be done on one line.

adduser: The --group, --ingroup, and --gid options are mutually exclusive.

You might be tempted to just omit the group. However, that command attempts to create a group if that matches the user id, and you may find you have more groups than users.

adduser: The GID 112 is already in use.

So make it a two-liner

sudo addgroup --gid 117 some-service
sudo adduser --system --no-create-home --disabled-login --uid 112 --gid 117 some-service

Comments