]> git.wh0rd.org - sysvinit.git/blame - man/sulogin.8
Adjust makefile to make sure the install directories are created before files are...
[sysvinit.git] / man / sulogin.8
CommitLineData
a74aeac6
PR
1'\" -*- coding: UTF-8 -*-
2.\" Copyright (C) 1998-2006 Miquel van Smoorenburg.
3.\"
4.\" This program is free software; you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation; either version 2 of the License, or
7.\" (at your option) any later version.
8.\"
9.\" This program is distributed in the hope that it will be useful,
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with this program; if not, write to the Free Software
16.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17.\"
18.TH SULOGIN 8 "17 Jan 2006" "" "Linux System Administrator's Manual"
19.SH NAME
20sulogin \- Single-user login
21.SH SYNOPSIS
22.B sulogin
23[ \fB\-e\fP ]
24[ \fB\-p\fP ]
25[ \fB\-t\fP \fISECONDS\fP ]
26[ \fITTY\fP ]
27.SH DESCRIPTION
28.I sulogin
29is invoked by \fBinit(8)\fP when the system goes into single user mode.
30(This is done through an entry in \fIinittab(5)\fP.)
31\fBInit\fP also
32tries to execute \fIsulogin\fP when
33the boot loader (e.g., \fBgrub\fP(8))
34passes it the \fB\-b\fP option.
35.PP
36The user is prompted
37.IP "" .5i
38Give root password for system maintenance
39.br
40(or type Control\-D for normal startup):
41.PP
42\fIsulogin\fP will be connected to the current terminal, or to the
43optional device that can be specified on the command line
44(typically \fB/dev/console\fP).
45.PP
46If the \fB\-t\fP option is used then the program only waits
47the given number of seconds for user input.
48.PP
49If the \fB\-p\fP option is used then the single-user shell is invoked
50with a \fIdash\fP as the first character in \fIargv[0]\fP.
51This causes the shell process to behave as a login shell.
52The default is \fInot\fP to do this,
53so that the shell will \fInot\fP read \fB/etc/profile\fP
54or \fB$HOME/.profile\fP at startup.
55.PP
56After the user exits the single-user shell,
57or presses control\-D at the prompt,
58the system will (continue to) boot to the default runlevel.
59.SH ENVIRONMENT VARIABLES
60\fIsulogin\fP looks for the environment variable \fBSUSHELL\fP or
61\fBsushell\fP to determine what shell to start. If the environment variable
62is not set, it will try to execute root's shell from /etc/passwd. If that
63fails it will fall back to \fB/bin/sh\fP.
64.PP
65This is very valuable together with the \fB\-b\fP option to init. To boot
66the system into single user mode, with the root file system mounted read/write,
67using a special "fail safe" shell that is statically linked (this example
68is valid for the LILO bootprompt)
69.PP
70boot: linux \-b rw sushell=/sbin/sash
71.SH FALLBACK METHODS
72\fIsulogin\fP checks the root password using the standard method (getpwnam)
73first.
74Then, if the \fB\-e\fP option was specified,
75\fIsulogin\fP examines these files directly to find the root password:
76.PP
77/etc/passwd,
78.br
79/etc/shadow (if present)
80.PP
81If they are damaged or nonexistent, sulogin will start a root shell
82without asking for a password. Only use the \fB\-e\fP option if you
83are sure the console is physically protected against unauthorized access.
84.SH AUTHOR
85Miquel van Smoorenburg <miquels@cistron.nl>
86.SH SEE ALSO
87init(8), inittab(5).