util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ludwig Nussel <ludwig.nussel@suse.de>
To: util-linux-ng@vger.kernel.org
Subject: Re: [pull] su.1 manual page
Date: Fri, 01 Jun 2012 11:23:12 +0200	[thread overview]
Message-ID: <4FC88A00.90004@suse.de> (raw)
In-Reply-To: <CAG27Bk0E79L9Tb7zi0M6ditsxr46LKJcy6Rn1KqFi5wrxTB4pw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

Sami Kerola wrote:
> On Thu, May 31, 2012 at 10:06 AM, Ludwig Nussel <ludwig.nussel@suse.de> wrote:
>>> Please find from my git a su(1) manual page candidate.  The text is
>>> almost one to one copy with GNU Coreutils 'su invocation' info page,
>>> so it is questionable if I "wrote" the man page.  To feel a little
>>
>> Hmm, I was about to write a man page from scratch. Should I continue or
>> do we use the coreutils man page?
> 
> 1. Continue writing from scratch, and propose your own man page candidate.

I've attached my suggestion

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 

[-- Attachment #2: su.1 --]
[-- Type: text/plain, Size: 4149 bytes --]

.TH SU 1 "May 2012" "util-linux" "User Commands"
.SH NAME
su \- Run a command with substitute user and group ID
.SH SYNOPSIS
.B su
[OPTIONS...] [\-] [USER [ARGS...]]
.SH DESCRIPTION
.B su
allows to run commands with substitute user and group ID.

When called without arguments \fBsu\fR defaults to running an interactive shell
as \fIroot\fR.

For backward compatibilty \fBsu\fR defaults to not change the
current directory and to only set the enviroment variables
\fBHOME\fR and \fBSHELL\fR (plus \fBUSER\fR and \fBLOGNAME\fR if the
target user is not root). It's recommended to always use the
\fB\-\-login\fR option (resp it's shortcut \fB-\fR) to avoid side
effects caused by mixing environments.

This version of \fBsu\fR uses PAM for authentication, account and
session management. Some configuration options found in other
\fBsu\fR implementations such as e.g. support of a wheel group have
to be configured via PAM.


.SH OPTIONS
.TP
\fB\-c\fR \fICOMMAND\fR, \fB\-\-command\fR=\fICOMMAND\fR
Pass COMMAND to the shell with the
.B -c
option

.TP
\fB\-\-session\-command\fR=\fICOMMAND\fR
Same as \fB-c\fR but do not create a new session (discouraged)

.TP
\fB\-f\fR, \fB\-\-fast\fR
Pass \fB\-f\fR to the shell which may or may not be useful depending
on the shell.

.TP
\fB\-\fR, \fB\-l\fR, \fB\-\-login\fR
Starts the shell as login shell with an environment similar to a
real login:

\- clears all environment variables except for \fBTERM\fR

\- initializes the environment variables \fBHOME\fR, \fBSHELL\fR,
\fBUSER\fR, \fBLOGNAME\fR, \fBPATH\fR

\- changes to the target user's home directory

\- sets argv[0] of the shell to \fB\-\fR in order to make the shell
a login shell

.TP
\fB\-m\fR, \fB\-p\fR, \fB\-\-preserve-environment\fR
Preserves the whole environment, ie does not set \fBHOME\fR,
\fBSHELL\fR, \fBUSER\fR nor \fBLOGNAME\fR.

.TP
\fB\-s\fR \fISHELL\fR, \fB\-\-shell\fR=\fISHELL\fR
Runs the specified shell instead of the default. The shell to run is
selected according to the following rules in order:

\- the shell specified with \fB\-\-shell\fR

\- The shell specified in the environment variable \fBSHELL\fR if
the \fB\-\-preserve-environment\fR option is used.

\- the shell listed in the passwd entry of the target user

\- /bin/sh

If the target user has a restricted shell (ie not listed in
/etc/shells) the \fB\-\-shell\fR option and the \fBSHELL\fR
environment variables are ignored unless the calling user is root.

.TP
\fB\-\-help\fR
Display help text and exit

.TP
\fB\-\-version\fR
Display version information and exit

.SH CONFIG FILES
.B su
reads the
.IR /etc/default/su
and
.IR /etc/login.defs
configuration files.
The following configuration items are relevant for
.BR su (1):
.PP
\fBFAIL_DELAY\fR (number)
.RS 4
Delay in seconds in case of authentication failure.
.RE
.PP
\fBENV_PATH\fR (string)
.RS 4
Defines the PATH environment variable for a regular
user. The default value is "/usr/local/bin:/bin:/usr/bin".
.RE
.PP
\fBENV_ROOTPATH\fR (string), \fBENV_SUPATH\fR (string)
.RS 4
Defines the PATH environment variable for root. The default value is
"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin".
.RE
.PP
\fBALWAYS_SET_PATH\fR (boolean)
.RS 4
If set to "yes" and \-\-login and \-\-preserve\-environment were
not specified initializes \fBPATH\fR
.RE
.SH EXIT STATUS
\fBsu\fR normall returns the exit status of the command it executed.
If the command was killed by a signal, \fBsu\fR returns the number
of the signal plus 128.

Exit status generated by \fBsu\fR itself:
.TP
1
Generic error before executing the requested command
.TP
126
The requested command could not be executed
.TP
127
The requested command could was not found
.SH FILES
.nf
/etc/pam.d/su   \- default PAM configuration file
/etc/pam.d/su-l \- PAM configuration file if \-\-login is specified
/etc/default/su
/etc/login.defs
.fi
.SH "SEE ALSO"
.BR pam (8),
.BR shells (5),
.BR login.defs (5),
.SH AUTHOR
Derived from coreutils' su which was based on an implemenation from David MacKenzie
.SH AVAILABILITY
The su command is part of the util-linux package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.

  parent reply	other threads:[~2012-06-01  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 18:04 [pull] su.1 manual page Sami Kerola
2012-05-31  8:06 ` Ludwig Nussel
2012-05-31  9:04   ` Sami Kerola
2012-05-31 18:18     ` Sami Kerola
2012-06-01  9:23     ` Ludwig Nussel [this message]
2012-06-02  5:40       ` Sami Kerola
2012-06-04  7:28         ` Ludwig Nussel
2012-06-05 12:50           ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC88A00.90004@suse.de \
    --to=ludwig.nussel@suse.de \
    --cc=util-linux-ng@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).