26

I want to know what are the implications of create an account using -r option?

# useradd -r ...

The help says:

-r, --system
  Create a system account.

  System users will be created with no aging information in /etc/shadow, and their 
  numeric identifiers are chosen in the SYS_UID_MIN-SYS_UID_MAX range, defined in
  /etc/login.defs, instead of UID_MIN-UID_MAX (and their GID counterparts for the
  creation of groups).

  Note that useradd will not create a home directory for such an user, regardless
  of the default setting in /etc/login.defs (CREATE_HOME). You have to specify the
  -m options if you want a home directory for a system account to be created.

But, beyond assign lower values to uid, gid and groups.

Question 1 What files are affected?

Question 2 What additional performance this type system account presents?

Question 3 What behavior ignores or stops submit?

Question 4 Can I change an account created with the "-r" option to an account as if it were created without that option?

1

2 Answers 2

13

Looking at the current source for useradd, one can see exactly what else changes when -r is specified:

  • subordinate uid/gid feature is disabled
  • mail directory is not created

So, no major difference from regular user account. Certainly no automatic performance gain or loss. I am not sure what you mean by Q1 and Q3; as for Q4 -- technically, yes; but since that involves changing user ID, any files owned by former UID must be chowned to new one.

1

It assigns UID/GID < 1000 vis:

$ sudo useradd -r  -U kismet
$ grep kismet /etc/passwd /etc/group
/etc/passwd:kismet:x:977:970::/home/kismet:/bin/bash
/etc/group:kismet:x:970:

Accounts with a UID<1000 are not normally listed by GDM (the login screen).

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .