2009-09-10 13:58:49 +05:30
|
|
|
'\" -*- coding: UTF-8 -*-
|
|
|
|
.\" Copyright (C) 1998-2006 Miquel van Smoorenburg.
|
|
|
|
.\"
|
|
|
|
.\" This program is free software; you can redistribute it and/or modify
|
|
|
|
.\" it under the terms of the GNU General Public License as published by
|
|
|
|
.\" the Free Software Foundation; either version 2 of the License, or
|
|
|
|
.\" (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" This program is distributed in the hope that it will be useful,
|
|
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
.\" GNU General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public License
|
|
|
|
.\" along with this program; if not, write to the Free Software
|
|
|
|
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
.\"
|
2021-12-28 01:44:42 +05:30
|
|
|
.TH SULOGIN 8 "17 Jan 2006" "sysvinit @VERSION@" "Linux System Administrator's Manual"
|
2009-09-10 13:58:49 +05:30
|
|
|
.SH NAME
|
|
|
|
sulogin \- Single-user login
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B sulogin
|
|
|
|
[ \fB\-e\fP ]
|
|
|
|
[ \fB\-p\fP ]
|
|
|
|
[ \fB\-t\fP \fISECONDS\fP ]
|
|
|
|
[ \fITTY\fP ]
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I sulogin
|
2021-12-28 01:44:42 +05:30
|
|
|
is invoked by \fBinit\fP(8) when the system goes into single user mode.
|
|
|
|
(This is done through an entry in \fBinittab\fP(5).)
|
|
|
|
\fBinit\fP(8) also
|
|
|
|
tries to execute \fBsulogin\fP when
|
2009-09-10 13:58:49 +05:30
|
|
|
the boot loader (e.g., \fBgrub\fP(8))
|
|
|
|
passes it the \fB\-b\fP option.
|
|
|
|
.PP
|
2021-12-28 01:44:42 +05:30
|
|
|
The user is prompted:
|
2009-09-10 13:58:49 +05:30
|
|
|
.IP "" .5i
|
|
|
|
Give root password for system maintenance
|
|
|
|
.br
|
|
|
|
(or type Control\-D for normal startup):
|
|
|
|
.PP
|
2021-12-28 01:44:42 +05:30
|
|
|
\fBsulogin\fP will be connected to the current terminal, or to the
|
2009-09-10 13:58:49 +05:30
|
|
|
optional device that can be specified on the command line
|
2021-12-28 01:44:42 +05:30
|
|
|
(typically \fI/dev/console\fP).
|
2009-09-10 13:58:49 +05:30
|
|
|
.PP
|
|
|
|
If the \fB\-t\fP option is used then the program only waits
|
|
|
|
the given number of seconds for user input.
|
|
|
|
.PP
|
|
|
|
If the \fB\-p\fP option is used then the single-user shell is invoked
|
|
|
|
with a \fIdash\fP as the first character in \fIargv[0]\fP.
|
|
|
|
This causes the shell process to behave as a login shell.
|
2021-12-28 01:44:42 +05:30
|
|
|
The default is \fBnot\fP to do this,
|
|
|
|
so that the shell will \fBnot\fP read \fI/etc/profile\fP
|
|
|
|
or \fI$HOME/.profile\fP at startup.
|
2009-09-10 13:58:49 +05:30
|
|
|
.PP
|
|
|
|
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.
|
|
|
|
.SH ENVIRONMENT VARIABLES
|
2021-12-28 01:44:42 +05:30
|
|
|
\fBsulogin\fP looks for the environment variable \fBSUSHELL\fP or
|
2009-09-10 13:58:49 +05:30
|
|
|
\fBsushell\fP to determine what shell to start. If the environment variable
|
2021-12-28 01:44:42 +05:30
|
|
|
is not set, it will try to execute root's shell from \fI/etc/passwd\fP. If that
|
|
|
|
fails it will fall back to \fI/bin/sh\fP.
|
2009-09-10 13:58:49 +05:30
|
|
|
.PP
|
2021-12-28 01:44:42 +05:30
|
|
|
This is very valuable together with the \fB\-b\fP option to \fBinit\fP(8). To boot
|
2009-09-10 13:58:49 +05:30
|
|
|
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)
|
|
|
|
.PP
|
|
|
|
boot: linux \-b rw sushell=/sbin/sash
|
|
|
|
.SH FALLBACK METHODS
|
2021-12-28 01:44:42 +05:30
|
|
|
\fBsulogin\fP checks the root password using the standard method (\fBgetpwnam\fP(3))
|
2009-09-10 13:58:49 +05:30
|
|
|
first.
|
|
|
|
Then, if the \fB\-e\fP option was specified,
|
2021-12-28 01:44:42 +05:30
|
|
|
\fBsulogin\fP examines these files directly to find the root password:
|
2009-09-10 13:58:49 +05:30
|
|
|
.PP
|
|
|
|
/etc/passwd,
|
|
|
|
.br
|
|
|
|
/etc/shadow (if present)
|
|
|
|
.PP
|
2021-12-28 01:44:42 +05:30
|
|
|
If they are damaged or nonexistent, \fBsulogin\fP will start a root shell
|
2009-09-10 13:58:49 +05:30
|
|
|
without asking for a password. Only use the \fB\-e\fP option if you
|
|
|
|
are sure the console is physically protected against unauthorized access.
|
|
|
|
.SH AUTHOR
|
2021-12-28 01:44:42 +05:30
|
|
|
.MT miquels@\:cistron\:.nl
|
|
|
|
Miquel van Smoorenburg
|
|
|
|
.ME
|
2009-09-10 13:58:49 +05:30
|
|
|
.SH SEE ALSO
|
2021-12-28 01:44:42 +05:30
|
|
|
.BR init (8),
|
|
|
|
.BR inittab (5)
|