SULOGIN(8) SULOGIN(8) 名前 sulogin - シングルユーザ login 書式 sulogin [tty-device] 説明 sulogin は、シングルユーザモードの時、ユーザがシステムにアクセス可能と なる前に、 /etc/init によって起動される。この機能は、init が適切に変 更 されているシステムか、あるいは /etc/inittab にシングルユーザ login のエ ントリがあるシステムでのみ利用できる。 次のようなプロンプトが出る。 Type control-d to proceed with normal startup, (or give root password for system maintenance): オプションのデバイス名引数が指定された場合を除き、標準のファイルディ ス クリプタを用いて入出力を行なう。 ユ ーザが正しい root のパスワードを入力した場合は、ログインセッションが 開始される。 EOF が押された場合は、システムはマルチユーザモードに入る。 ユ ー ザがシングルユーザシェルを抜けた、あるいは (シェルに入る前に) EOF を押した後には、システムはマルチユーザモードに入るために必要な初期化 処 理を開始する。 警告 このコマンドが利用できるようにするには、 init が /bin/sh ではなく sulo- gin を呼ぶようになっているか、または inittab 中にシングルユーザログイン に対する設定がされている必要がある。例えば、 co:s:respawn:/etc/sulogin /dev/console という行を書いておけば、シングルユーザモードでは sulogin コマンドが実行 される。 可能な限り完全な環境が提供される。しかし、様々なデバイスがマウントさ れ て いなかったり初期化されていなかったりするため、多くのユーザコマンドが 使えなかったり機能しないかもしれない。 ファイル /etc/passwd - ユーザアカウント情報 /etc/shadow - 暗号化されたパスワードと有効期限の情報 /.profile - シングルユーザシェル用の初期化スクリプト 関連項目 login(1), sh(1), init(8) 著者 Julianne Frances Haugh (jockgrrl@ix.netcom.com) SULOGIN(8)
SULOGIN(8) Linux System Administrator’s Manual SULOGIN(8)
NAME
sulogin - Single-user login
SYNOPSIS
sulogin [ -e ] [ -p ] [ -t SECONDS ] [ TTY ]
DESCRIPTION
sulogin can be invoked by init(8) when the system goes into single user
mode. (This is done through an entry in inittab(5).) Init also tries
to execute sulogin when the boot loader (e.g., grub(8)) passes it the
-b option.
The user is prompted
Give root password for system maintenance
(or type Control-D for normal startup):
sulogin will be connected to the current terminal, or to the optional
device that can be specified on the command line (typically /dev/con-
sole).
If the -t option is used then the program only waits the given number
of seconds for user input.
If the -p option is used then the single-user shell is invoked with a
dash as the first character in argv[0]. This causes the shell process
to behave as a login shell. The default is not to do this, so that the
shell will not read /etc/profile or $HOME/.profile at startup.
After the user exits the single-user shell, or presses control-D at the
prompt, the system will (continue to) boot to the default runlevel.
ENVIRONMENT VARIABLES
sulogin looks for the environment variable SUSHELL or sushell to deter-
mine what shell to start. If the environment variable is not set, it
will try to execute root’s shell from /etc/passwd. If that fails it
will fall back to /bin/sh.
This is very valuable together with the -b option to init. To boot the
system into single user mode, with the root file system mounted
read/write, using a special "fail safe" shell that is statically linked
(this example is valid for the LILO bootprompt)
boot: linux -b rw sushell=/sbin/sash
FALLBACK METHODS
sulogin checks the root password using the standard method (getpwnam)
first. Then, if the -e option was specified, sulogin examines these
files directly to find the root password:
/etc/passwd,
/etc/shadow (if present)
If they are damaged or nonexistent, sulogin will start a root shell
without asking for a password. Only use the -e option if you are sure
the console is physically protected against unauthorized access.
AUTHOR
Miquel van Smoorenburg
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa