创建系统帐户“useradd -r”的含义 Linux Fedora/RHEL/CentOS

QA_*_*Col 17 rhel administration centos group useradd

我想知道使用-r选项创建帐户的含义是什么?

# useradd -r ...

帮助说:

-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.
Run Code Online (Sandbox Code Playgroud)

但是,除了为uidgidgroups分配较低的值。

问题 1 哪些文件受到影响?

问题 2 这种类型的系统帐户有什么额外的性能?

问题 3 什么行为忽略或停止提交?

问题 4 我可以将使用“-r”选项创建的帐户更改为没有该选项创建的帐户吗?

sen*_*nfo 8

查看 useradd的当前,可以准确地看到在-r指定时还有什么变化:

  • 从属 uid/gid 功能被禁用
  • 未创建邮件目录

因此,与普通用户帐户没有太大区别。当然没有自动的性能增益或损失。我不确定您所说的 Q1 和 Q3 是什么意思;至于第四季度——从技术上讲,是的;但由于这涉及更改用户 ID,因此必须将前 UID 拥有的任何文件chown编辑为新的。