SULOGIN(8)

名称
sulogin - Single-user login

SYNTAX

sulogin [tty-device]

描述

The sulogin command is invoked by init prior to allowing the user access to the system when in single user mode. This feature may only be available on certain systems where init has been modified accordingly, or where the /etc/inittab has an entry for a single user login.

The user is prompted

Type control-d to proceed with normal startup, (or give root password for system maintenance):

Input and output will be performed with the standard file descriptors unless the optional device name argument is provided.

If the user enters the correct root password, a login session is initiated. When EOF is pressed instead, the system enters multi-user mode.

After the user exits the single-user shell, or presses EOF, the system begins the initialization process required to enter multi-user mode.

CAVEATS

This command can only be used if init has been modified to call sulogin instead of /bin/sh, or if the user has set the inittab to support a single user login. For example, the line:

co:s:respawn:/etc/sulogin /dev/console

should execute the sulogin command in single user mode.

As complete an environment as possible is created. However, various devices may be unmounted or uninitialized and many of the user commands may be unavailable or nonfunctional as a result.

配置文件

在 /etc/login.defs 中有如下配置变量，可以用来更改此工具的行为：

ENV_HZ (string)
    如果设置了，将会用于在用户登录时定义 HZ 环境变量。值必须以 HZ= 开头。Linux 上的常用值是 HZ=100。

ENV_TZ (string)
    如果设置了，它将用于在用户登录时定义 TZ 环境变量。此值可以是以 TZ= 开头的时区名(例如 TZ=CST6CDT)，或者是包含时区规则的文件完整路径(例如 /etc/tzname)。

    如果将完整路径指定为了一个不存在或不可读的文件，则默认使用 TZ=CST6CDT。

文件

/etc/passwd
    用户账户信息。

/etc/shadow
    安全用户账户信息。

参见

login(1), sh(1), init(8).