>_ IzzyLab

Hands-on task

This task is step 20 of the course “Users, groups and permissions”

Create a service user

medium~5 min

Create a service user svc with the following properties: primary group svc (create it if it doesn't exist), supplementary groups appops and deployers, login shell /usr/sbin/nologin (interactive login is disabled), and no home directory created.

What you'll practise:
  • useradd
  • -g primary group
  • -G supplementary
  • -s shell
  • service account

Topic breakdown

useradd creates an account; the key flags are: -g — primary group (exactly one, must exist), -G — list of supplementary groups, -s — login shell, -M/-m — without/with creating a home directory, -r — system (service) account with a UID from the system range. The /usr/sbin/nologin shell (or /bin/false) prevents logging in under the account — standard practice for service users that only need permissions and groups, not interactive access.

What's checked

  1. primary group is svc
  2. member of appops and deployers
  3. shell is nologin
  4. no home directory created

What it looks like