summaryrefslogtreecommitdiff
path: root/man/zh_CN/man1/su.1
diff options
context:
space:
mode:
Diffstat (limited to 'man/zh_CN/man1/su.1')
-rw-r--r--man/zh_CN/man1/su.1241
1 files changed, 132 insertions, 109 deletions
diff --git a/man/zh_CN/man1/su.1 b/man/zh_CN/man1/su.1
index 258f80e2..9bf038f0 100644
--- a/man/zh_CN/man1/su.1
+++ b/man/zh_CN/man1/su.1
@@ -2,12 +2,12 @@
.\" Title: su
.\" Author: Julianne Frances Haugh
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 2019-06-13
+.\" Date: 2019-12-01
.\" Manual: 用户命令
-.\" Source: shadow-utils 4.7
+.\" Source: shadow-utils 4.8
.\" Language: Chinese Simplified
.\"
-.TH "SU" "1" "2019-06-13" "shadow\-utils 4\&.7" "用户命令"
+.TH "SU" "1" "2019-12-01" "shadow\-utils 4\&.8" "用户命令"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -55,28 +55,30 @@ option is special: it is also recognized after
.PP
如果合适,将提示用户输入一个密码。输入无效的密码会产生一个错误消息。所有的尝试,无论成功还是失败,都会被记录,以检测对系统的滥用。
.PP
-当前环境会传递给新 shell。对于普通用户,\fB$PATH\fR
-的值重置为
-/bin:/usr/bin,而对于超级用户则是
-/sbin:/bin:/usr/sbin:/usr/bin。这会随
-/etc/login\&.defs
-中的
+The current environment is passed to the new shell\&. The value of
+\fB$PATH\fR
+is reset to
+/bin:/usr/bin
+for normal users, or
+/sbin:/bin:/usr/sbin:/usr/bin
+for the superuser\&. This may be changed with the
\fBENV_PATH\fR
-和
+and
\fBENV_SUPATH\fR
-值改变。
+definitions in
+/etc/login\&.defs\&.
.PP
在登录 shell 中以第一个字符是\(lq*\(rq标注的是子系统登录。给定的主目录将被用于用户实际登录的新文件系统的根。
.SH "选项"
.PP
+The options which apply to the
\fBsu\fR
-命令可以接受的选项有:
+command are:
.PP
\fB\-c\fR, \fB\-\-command\fR\ \&\fICOMMAND\fR
.RS 4
-通过使用其
-\fB\-c\fR
-选项,指定一个由 shell 运行的命令。
+Specify a command that will be invoked by the shell using its
+\fB\-c\fR\&.
.sp
The executed command will have no controlling terminal\&. This option cannot be used to execute interactive programs which need a controlling TTY\&.
.RE
@@ -98,125 +100,134 @@ and
.RS 4
将使用的 shell。
.sp
-使用的 shell 在如下中选择(高优先级在前):.PP
+The invoked shell is chosen from (highest priority first):
+.PP
.RS 4
-通过 \-\-shell 指定的 shell。
+The shell specified with \-\-shell\&.
.RE
.PP
.RS 4
-如果使用了
-\fB\-\-preserve\-environment\fR,shell 将由
+If
+\fB\-\-preserve\-environment\fR
+is used, the shell specified by the
\fB$SHELL\fR
-环境变量指定。
+environment variable\&.
.RE
.PP
.RS 4
-在
+The shell indicated in the
/etc/passwd
-的相应项中为目标用户指定的 shell。
+entry for the target user\&.
.RE
.PP
.RS 4
-如果无法通过以上办法找到一个 shell,则使用
-/bin/sh。
+/bin/sh
+if a shell could not be found by any above method\&.
.RE
.sp
-如果目标用户的 shell 是有限制的(即,/etc/passwd
-中用户项中的 shell 字段没有在
-/etc/shells
-中列出),那么
+If the target user has a restricted shell (i\&.e\&. the shell field of this user\*(Aqs entry in
+/etc/passwd
+is not listed in
+/etc/shells), then the
\fB\-\-shell\fR
-选项或
+option or the
\fB$SHELL\fR
-环境变量不会带入账户,除非
+environment variable won\*(Aqt be taken into account, unless
\fBsu\fR
-是被 root 调用的。
+is called by root\&.
.RE
.PP
\fB\-m\fR, \fB\-p\fR, \fB\-\-preserve\-environment\fR
.RS 4
-保留当前环境,除非:.PP
+Preserve the current environment, except for:
+.PP
\fB$PATH\fR
.RS 4
-根据
+reset according to the
/etc/login\&.defs
-中的
+options
\fBENV_PATH\fR
or
\fBENV_SUPATH\fR
-选项重设 (请往下看)
+(see below);
.RE
.PP
\fB$IFS\fR
.RS 4
-如果已经设置了,重设
-\(lq<space><tab><newline>\(rq。
+reset to
+\(lq<space><tab><newline>\(rq, if it was set\&.
.RE
.sp
-如果用户的 shell 受限,此选项无效 (除非是 root 调用的
-\fBsu\fR)。
+If the target user has a restricted shell, this option has no effect (unless
+\fBsu\fR
+is called by root)\&.
.sp
-注意,环境的默认行为如下:.PP
+Note that the default behavior for the environment is the following:
+.PP
.RS 4
The
\fB$HOME\fR,
\fB$SHELL\fR,
\fB$USER\fR,
\fB$LOGNAME\fR,
-\fB$PATH\fR, 和
+\fB$PATH\fR, and
\fB$IFS\fR
-这些环境变量会被重置。
+environment variables are reset\&.
.RE
.PP
.RS 4
-如果没有使用
-\fB\-\-login\fR,复制环境,上述几个变量除外。
+If
+\fB\-\-login\fR
+is not used, the environment is copied, except for the variables above\&.
.RE
.PP
.RS 4
-如果使用了
-\fB\-\-login\fR,如果设置了
+If
+\fB\-\-login\fR
+is used, the
\fB$TERM\fR,
\fB$COLORTERM\fR,
-\fB$DISPLAY\fR
-和
-\fB$XAUTHORITY\fR,这些环境变量也会被重置。
+\fB$DISPLAY\fR, and
+\fB$XAUTHORITY\fR
+environment variables are copied if they were set\&.
.RE
.PP
.RS 4
-如果使用了
-\fB\-\-login\fR,环境变量
+If
+\fB\-\-login\fR
+is used, the
\fB$TZ\fR,
\fB$HZ\fR, and
\fB$MAIL\fR
-也会根据
+environment variables are set according to the
/etc/login\&.defs
-中的选项
+options
\fBENV_TZ\fR,
\fBENV_HZ\fR,
-\fBMAIL_DIR\fR
-和
+\fBMAIL_DIR\fR, and
\fBMAIL_FILE\fR
-重置 (请看下边)。
+(see below)\&.
.RE
.PP
.RS 4
-如果使用了
-\fB\-\-login\fR,其它环境变量可能会根据
+If
+\fB\-\-login\fR
+is used, other environment variables might be set by the
\fBENVIRON_FILE\fR
-文件来设置(请看下边)。
+file (see below)\&.
.RE
+.sp
.RE
.SH "CAVEATS"
.PP
-此版本的
+This version of
\fBsu\fR
-有很多编译选项,在某些机器上,可能只使用了其中的一部分。
+has many compilation options, only some of which may be in use at any particular site\&.
.SH "配置文件"
.PP
-在
+The following configuration variables in
/etc/login\&.defs
-中有如下配置变量,可以用来更改此工具的行为:
+change the behavior of this tool:
.PP
\fBCONSOLE\fR (string)
.RS 4
@@ -229,24 +240,24 @@ The
.PP
\fBCONSOLE_GROUPS\fR (string)
.RS 4
-在控制台登录时,添加到用户附加组集中的组列表(就如 CONSOLE 所确定的)。默认是无。
-使用时需要注意:这可能使用户获取这些组的永久权限,甚至登录到的不是此控制台时。
+List of groups to add to the user\*(Aqs supplementary groups set when logging in on the console (as determined by the CONSOLE setting)\&. Default is none\&.
+
+Use with caution \- it is possible for users to gain permanent access to these groups, even when not logged in on the console\&.
.RE
.PP
\fBDEFAULT_HOME\fR (boolean)
.RS 4
如果不能 cd 到主目录时,说明是否允许登录。默认是否。
.sp
-如果设置为
-\fIyes\fR,如果不能 cd 到主目录时,用户将会登录到根目录(/)。
+If set to
+\fIyes\fR, the user will login in the root (/) directory if it is not possible to cd to her home directory\&.
.RE
.PP
\fBENV_HZ\fR (string)
.RS 4
-如果设置了,将会用于在用户登录时定义 HZ 环境变量。值必须以
-\fIHZ=\fR
-开头。Linux 上的常用值是
-\fIHZ=100\fR。
+If set, it will be used to define the HZ environment variable when a user login\&. The value must be preceded by
+\fIHZ=\fR\&. A common value on Linux is
+\fIHZ=100\fR\&.
.RE
.PP
\fBENVIRON_FILE\fR (string)
@@ -274,22 +285,22 @@ If set, it will be used to define the PATH environment variable when the superus
.PP
\fBENV_TZ\fR (string)
.RS 4
-如果设置了,它将用于在用户登录时定义 TZ 环境变量。此值可以是以
+If set, it will be used to define the TZ environment variable when a user login\&. The value can be the name of a timezone preceded by
\fITZ=\fR
-开头的时区名(例如
-\fITZ=CST6CDT\fR),或者是包含时区规则的文件完整路径(例如
-/etc/tzname)。
+(for example
+\fITZ=CST6CDT\fR), or the full path to the file containing the timezone specification (for example
+/etc/tzname)\&.
.sp
-如果将完整路径指定为了一个不存在或不可读的文件,则默认使用
-\fITZ=CST6CDT\fR。
+If a full path is specified but the file does not exist or cannot be read, the default is to use
+\fITZ=CST6CDT\fR\&.
.RE
.PP
\fBLOGIN_STRING\fR (string)
.RS 4
此字符串用于提示输入密码。默认是 "Password: ",或者翻译了的结果(汉语中翻译为了\(lq密码:\(rq)。如果设置了此变量,提示不会被翻译。
.sp
-如果字符串包含
-\fI%s\fR,将会被用户名替换。
+If the string contains
+\fI%s\fR, this will be replaced by the user\*(Aqs name\&.
.RE
.PP
\fBMAIL_CHECK_ENAB\fR (boolean)
@@ -309,21 +320,22 @@ If set, it will be used to define the PATH environment variable when the superus
定义用户邮箱文件的位置(相对于主目录)。
.RE
.PP
+The
\fBMAIL_DIR\fR
and
\fBMAIL_FILE\fR
-变量由
-\fBuseradd\fR,\fBusermod\fR
-和
+variables are used by
+\fBuseradd\fR,
+\fBusermod\fR, and
\fBuserdel\fR
-用于创建、移动或删除用户邮箱。
+to create, move, or delete the user\*(Aqs mail spool\&.
.PP
-如果
+If
\fBMAIL_CHECK_ENAB\fR
-设置为
-\fIyes\fR,它们也被用于定义
+is set to
+\fIyes\fR, they are also used to define the
\fBMAIL\fR
-环境变量。
+environment variable\&.
.PP
\fBQUOTAS_ENAB\fR (boolean)
.RS 4
@@ -344,28 +356,35 @@ and ulimit, umask, and niceness from the user\*(Aqs passwd gecos field\&.
.PP
\fBSU_WHEEL_ONLY\fR (boolean)
.RS 4
-如果为
-\fIyes\fR,用户必须在
+If
+\fIyes\fR, the user must be listed as a member of the first gid 0 group in
/etc/group
-中别设定为 GID 为 0 的组(在大部分 Linux 上叫
-\fIroot\fR)的成员。
+(called
+\fIroot\fR
+on most Linux systems) to be able to
+\fBsu\fR
+to uid 0 accounts\&. If the group doesn\*(Aqt exist or is empty, no one will be able to
+\fBsu\fR
+to uid 0\&.
.RE
.PP
\fBSYSLOG_SU_ENAB\fR (boolean)
.RS 4
-除了 sulog 文件日志,也为
+Enable "syslog" logging of
\fBsu\fR
-活动启用\(lqsyslog\(rq日志。
+activity \- in addition to sulog file logging\&.
.RE
.PP
\fBUSERGROUPS_ENAB\fR (boolean)
.RS 4
如果 uid 和 gid 相同,用户名和主用户名也相同,使非 root 组的组掩码位和属主位相同 (如:022 \-> 002, 077 \-> 007)。
.sp
-如果设置为
-\fIyes\fR,如果组中没有成员了,\fBuserdel\fR
-将移除此用户组,\fBuseradd\fR
-创建用户时,也会创建一个同名的默认组。
+If set to
+\fIyes\fR,
+\fBuserdel\fR
+will remove the user\*(Aqs group if it contains no more members, and
+\fBuseradd\fR
+will create by default a group with the name of the user\&.
.RE
.SH "文件"
.PP
@@ -385,37 +404,41 @@ Shadow 密码套件配置。
.RE
.SH "退出值"
.PP
-成功时,\fBsu\fR
-返回执行的命令的退出值。
+On success,
+\fBsu\fR
+returns the exit value of the command it executed\&.
.PP
-如果命令被信号结束,\fBsu\fR
-返回此信号的编号加 128。
+If this command was terminated by a signal,
+\fBsu\fR
+returns the number of this signal plus 128\&.
.PP
-如果 su 必须要杀死此命令(因为已经要求它结束,可是却没有及时结束),\fBsu\fR
-返回 255。
+If su has to kill the command (because it was asked to terminate, and the command did not terminate in time),
+\fBsu\fR
+returns 255\&.
.PP
+Some exit values from
\fBsu\fR
-中的某些退出值与执行的命令无关:
+are independent from the executed command:
.PP
\fI0\fR
.RS 4
-成功 (只有
-\fB\-\-help\fR)
+success (\fB\-\-help\fR
+only)
.RE
.PP
\fI1\fR
.RS 4
-系统或者认证失败
+System or authentication failure
.RE
.PP
\fI126\fR
.RS 4
-要求的命令不存在
+The requested command was not found
.RE
.PP
\fI127\fR
.RS 4
-请求的命令不能执行
+The requested command could not be executed
.RE
.SH "参见"
.PP