diff options
Diffstat (limited to 'man/zh_CN/man1/login.1')
-rw-r--r-- | man/zh_CN/man1/login.1 | 482 |
1 files changed, 482 insertions, 0 deletions
diff --git a/man/zh_CN/man1/login.1 b/man/zh_CN/man1/login.1 new file mode 100644 index 00000000..0bb56959 --- /dev/null +++ b/man/zh_CN/man1/login.1 @@ -0,0 +1,482 @@ +'\" t +.\" Title: login +.\" Author: Julianne Frances Haugh +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 2012-05-25 +.\" Manual: 用户命令 +.\" Source: shadow-utils 4.1.5.1 +.\" Language: Chinese Simplified +.\" +.TH "LOGIN" "1" "2012-05-25" "shadow\-utils 4\&.1\&.5\&.1" "用户命令" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "名称" +login \- 在系统上启动回话 +.SH "大纲" +.HP \w'\fBlogin\fR\ 'u +\fBlogin\fR [\-p] [\-h\ \fI主机\fR] [\fI用户名\fR] [\fIENV=VAR\fR...] +.HP \w'\fBlogin\fR\ 'u +\fBlogin\fR [\-p] [\-h\ \fI主机\fR] \-f \fI用户名\fR +.HP \w'\fBlogin\fR\ 'u +\fBlogin\fR [\-p] \-r\ \fI主机\fR +.SH "描述" +.PP +The +\fBlogin\fR +program is used to establish a new session with the system\&. It is normally invoked automatically by responding to the +\fIlogin:\fR +prompt on the user\*(Aqs terminal\&. +\fBlogin\fR +may be special to the shell and may not be invoked as a sub\-process\&. When called from a shell, +\fBlogin\fR +should be executed as +\fBexec login\fR +which will cause the user to exit from the current shell (and thus will prevent the new logged in user to return to the session of the caller)\&. Attempting to execute +\fBlogin\fR +from any shell but the login shell will produce an error message\&. +.PP +The user is then prompted for a password, where appropriate\&. Echoing is disabled to prevent revealing the password\&. Only a small number of password failures are permitted before +\fBlogin\fR +exits and the communications link is severed\&. +.PP +If password aging has been enabled for your account, you may be prompted for a new password before proceeding\&. You will be forced to provide your old password and the new password before continuing\&. Please refer to +\fBpasswd\fR(1) +for more information\&. +.PP +After a successful login, you will be informed of any system messages and the presence of mail\&. You may turn off the printing of the system message file, +/etc/motd, by creating a zero\-length file +\&.hushlogin +in your login directory\&. The mail message will be one of "\fIYou have new mail\&.\fR", "\fIYou have mail\&.\fR", or "\fINo Mail\&.\fR" according to the condition of your mailbox\&. +.PP +Your user and group ID will be set according to their values in the +/etc/passwd +file\&. The value for +\fB$HOME\fR, +\fB$SHELL\fR, +\fB$PATH\fR, +\fB$LOGNAME\fR, and +\fB$MAIL\fR +are set according to the appropriate fields in the password entry\&. Ulimit, umask and nice values may also be set according to entries in the GECOS field\&. +.PP +On some installations, the environmental variable +\fB$TERM\fR +will be initialized to the terminal type on your tty line, as specified in +/etc/ttytype\&. +.PP +命令解释器的初始化脚本也可能执行。请参考手册中相应的章节来获取关于此功能的更多信息。 +.PP +在登录 shell 中以第一个字符是\(lq*\(rq标注的是子系统登录。给定的主目录将被用于用户实际登录的新文件系统的根。 +.PP +The +\fBlogin\fR +program is NOT responsible for removing users from the utmp file\&. It is the responsibility of +\fBgetty\fR(8) +and +\fBinit\fR(8) +to clean up apparent ownership of a terminal session\&. If you use +\fBlogin\fR +from the shell prompt without +\fBexec\fR, the user you use will continue to appear to be logged in even after you log out of the "subsession"\&. +.SH "选项" +.PP +\fB\-f\fR +.RS 4 +不要执行认证,用户已经预认证过。 +.sp +注意:此时,\fIusername\fR +是强制的。 +.RE +.PP +\fB\-h\fR +.RS 4 +此登录的远程主机名。 +.RE +.PP +\fB\-p\fR +.RS 4 +保留环境。 +.RE +.PP +\fB\-r\fR +.RS 4 +为 rlogin (远程登录)执行 autologin (自动登录)协议。 +.RE +.PP +\fB\-r\fR, +\fB\-h\fR +and +\fB\-f\fR +只能用于 root 使用 +\fBlogin\fR +时。 +.SH "CAVEATS" +.PP +此版本的 +\fBlogin\fR +有很多编译选项,只有一部分可以在任何站点使用。 +.PP +文件的位置由系统配置决定。 +.PP +The +\fBlogin\fR +program is NOT responsible for removing users from the utmp file\&. It is the responsibility of +\fBgetty\fR(8) +and +\fBinit\fR(8) +to clean up apparent ownership of a terminal session\&. If you use +\fBlogin\fR +from the shell prompt without +\fBexec\fR, the user you use will continue to appear to be logged in even after you log out of the "subsession"\&. +.PP +As with any program, +\fBlogin\fR\*(Aqs appearance can be faked\&. If non\-trusted users have physical access to a machine, an attacker could use this to obtain the password of the next person coming to sit in front of the machine\&. Under Linux, the SAK mechanism can be used by users to initiate a trusted path and prevent this kind of attack\&. +.SH "配置文件" +.PP +在 +/etc/login\&.defs +中有如下配置变量,可以用来更改此工具的行为: +.PP +\fBCONSOLE\fR (string) +.RS 4 +如果定义了,或者是包含设备名(没行一个)的文件的完整路径名,或者是\(lq:\(rq分隔的设备名列表。将只会在这写设备上允许 root 登录。 +.sp +如果没有定义,可以在任何设备上使用 root。 +.sp +指定的设备时不带 /dev/ 前缀。 +.RE +.PP +\fBCONSOLE_GROUPS\fR (string) +.RS 4 +在控制台登录时,添加到用户附加组集中的组列表(就如 CONSOLE 所确定的)。默认是无。 +使用时需要注意:这可能使用户获取这些组的永久权限,甚至登录到的不是此控制台时。 +.RE +.PP +\fBDEFAULT_HOME\fR (boolean) +.RS 4 +如果不能 cd 到主目录时,说明是否允许登录。默认是否。 +.sp +如果设置为 +\fIyes\fR,如果不能 cd 到主目录时,用户将会登录到根目录(/)。 +.RE +.PP +\fBENV_HZ\fR (string) +.RS 4 +如果设置了,将会用于在用户登录时定义 HZ 环境变量。值必须以 +\fIHZ=\fR +开头。Linux 上的常用值是 +\fIHZ=100\fR。 +.RE +.PP +\fBENV_PATH\fR (string) +.RS 4 +If set, it will be used to define the PATH environment variable when a regular user login\&. The value is a colon separated list of paths (for example +\fI/bin:/usr/bin\fR) and can be preceded by +\fIPATH=\fR\&. The default value is +\fIPATH=/bin:/usr/bin\fR\&. +.RE +.PP +\fBENV_SUPATH\fR (string) +.RS 4 +If set, it will be used to define the PATH environment variable when the superuser login\&. The value is a colon separated list of paths (for example +\fI/sbin:/bin:/usr/sbin:/usr/bin\fR) and can be preceded by +\fIPATH=\fR\&. The default value is +\fIPATH=/sbin:/bin:/usr/sbin:/usr/bin\fR\&. +.RE +.PP +\fBENV_TZ\fR (string) +.RS 4 +如果设置了,它将用于在用户登录时定义 TZ 环境变量。此值可以是以 +\fITZ=\fR +开头的时区名(例如 +\fITZ=CST6CDT\fR),或者是包含时区规则的文件完整路径(例如 +/etc/tzname)。 +.sp +如果将完整路径指定为了一个不存在或不可读的文件,则默认使用 +\fITZ=CST6CDT\fR。 +.RE +.PP +\fBENVIRON_FILE\fR (string) +.RS 4 +如果此文件存在,并且可读,将会从中读取登录环境。所有行都必须是 name=value 的格式。 +.sp +以 # 开头的行将视为注释,并被忽略。 +.RE +.PP +\fBERASECHAR\fR (number) +.RS 4 +终端擦除字符 (\fI010\fR += backspace, +\fI0177\fR += DEL)。 +.sp +此值可以使用前缀\(lq0\(rq表示八进制,\(lq0x\(rq表示十六进制。 +.RE +.PP +\fBFAIL_DELAY\fR (number) +.RS 4 +登录失败后,等待多少秒才再允许登录。 +.RE +.PP +\fBFAILLOG_ENAB\fR (boolean) +.RS 4 +允许登录并显示 +/var/log/faillog +登录失败信息。 +.RE +.PP +\fBFAKE_SHELL\fR (string) +.RS 4 +如果设置了,\fBlogin\fR +将执行此 shell 而不是在 +/etc/passwd +中指定的用户 shell。 +.RE +.PP +\fBFTMP_FILE\fR (string) +.RS 4 +如果定义,登录失败会以 utmp 格式记录在此文件中。 +.RE +.PP +\fBHUSHLOGIN_FILE\fR (string) +.RS 4 +If defined, this file can inhibit all the usual chatter during the login sequence\&. If a full pathname is specified, then hushed mode will be enabled if the user\*(Aqs name or shell are found in the file\&. If not a full pathname, then hushed mode will be enabled if the file exists in the user\*(Aqs home directory\&. +.RE +.PP +\fBISSUE_FILE\fR (string) +.RS 4 +如果定义了,此文件将在每次的登录提示之前现实。 +.RE +.PP +\fBKILLCHAR\fR (number) +.RS 4 +终端 KILL 字符 (\fI025\fR += CTRL/U)。 +.sp +此值可以使用前缀\(lq0\(rq表示八进制,\(lq0x\(rq表示十六进制。 +.RE +.PP +\fBLASTLOG_ENAB\fR (boolean) +.RS 4 +允许记录和显示 /var/log/lastlog 登录时间信息。 +.RE +.PP +\fBLOGIN_RETRIES\fR (number) +.RS 4 +密码错误时,重试的最大次数。 +.RE +.PP +\fBLOGIN_STRING\fR (string) +.RS 4 +此字符串用于提示输入密码。默认是 "Password: ",或者翻译了的结果(汉语中翻译为了\(lq密码:\(rq)。如果设置了此变量,提示不会被翻译。 +.sp +如果字符串包含 +\fI%s\fR,将会被用户名替换。 +.RE +.PP +\fBLOGIN_TIMEOUT\fR (number) +.RS 4 +最大登录时间(以秒为单位)。 +.RE +.PP +\fBLOG_OK_LOGINS\fR (boolean) +.RS 4 +允许记录成功登录。 +.RE +.PP +\fBLOG_UNKFAIL_ENAB\fR (boolean) +.RS 4 +在记录到登录失败时,允许记录未知用户名。 +.sp +注意:如果用户不小心将密码输入到了登录名中,记录未知用户名可能是一个安全隐患。 +.RE +.PP +\fBMAIL_CHECK_ENAB\fR (boolean) +.RS 4 +启用登录时检查和现实邮箱状态。 +.sp +如果 shell 的启动文件已经检查了邮件("mailx \-e" 或者其它同功能的工具),您应该禁用它。 +.RE +.PP +\fBMAIL_DIR\fR (string) +.RS 4 +邮箱目录。修改或删除用户账户时需要处理邮箱,如果没有指定,将使用编译时指定的默认值。 +.RE +.PP +\fBMAIL_FILE\fR (string) +.RS 4 +定义用户邮箱文件的位置(相对于主目录)。 +.RE +.PP +\fBMAIL_DIR\fR +and +\fBMAIL_FILE\fR +变量由 +\fBuseradd\fR,\fBusermod\fR +和 +\fBuserdel\fR +用于创建、移动或删除用户邮箱。 +.PP +如果 +\fBMAIL_CHECK_ENAB\fR +设置为 +\fIyes\fR,它们也被用于定义 +\fBMAIL\fR +环境变量。 +.PP +\fBMOTD_FILE\fR (string) +.RS 4 +If defined, ":" delimited list of "message of the day" files to be displayed upon login\&. +.RE +.PP +\fBNOLOGINS_FILE\fR (string) +.RS 4 +If defined, name of file whose presence will inhibit non\-root logins\&. The contents of this file should be a message indicating why logins are inhibited\&. +.RE +.PP +\fBPORTTIME_CHECKS_ENAB\fR (boolean) +.RS 4 +Enable checking of time restrictions specified in +/etc/porttime\&. +.RE +.PP +\fBQUOTAS_ENAB\fR (boolean) +.RS 4 +Enable setting of resource limits from +/etc/limits +and ulimit, umask, and niceness from the user\*(Aqs passwd gecos field\&. +.RE +.PP +\fBTTYGROUP\fR (string), \fBTTYPERM\fR (string) +.RS 4 +The terminal permissions: the login tty will be owned by the +\fBTTYGROUP\fR +group, and the permissions will be set to +\fBTTYPERM\fR\&. +.sp +By default, the ownership of the terminal is set to the user\*(Aqs primary group and the permissions are set to +\fI0600\fR\&. +.sp + +\fBTTYGROUP\fR +can be either the name of a group or a numeric group identifier\&. +.sp +If you have a +\fBwrite\fR +program which is "setgid" to a special group which owns the terminals, define TTYGROUP to the group number and TTYPERM to 0620\&. Otherwise leave TTYGROUP commented out and assign TTYPERM to either 622 or 600\&. +.RE +.PP +\fBTTYTYPE_FILE\fR (string) +.RS 4 +If defined, file which maps tty line to TERM environment parameter\&. Each line of the file is in a format something like "vt100 tty01"\&. +.RE +.PP +\fBULIMIT\fR (number) +.RS 4 +默认 +\fBulimit\fR +值。 +.RE +.PP +\fBUMASK\fR (number) +.RS 4 +文件模式创建掩码初始化为此值。如果没有指定,掩码初始化为 022。 +.sp +\fBuseradd\fR +和 +\fBnewusers\fR +使用此掩码设置它们创建的用户主目录的模式。 +.sp +也被 +\fBlogin\fR +用于指定用户的初始 umask。注意,此掩码可以被用户的 GECOS 行覆盖(当设置了 +\fBQUOTAS_ENAB\fR +时),也可以被带 +\fIK\fR +指示符的 +\fBlimits\fR(5) +定义的限制值覆盖。 +.RE +.PP +\fBUSERGROUPS_ENAB\fR (boolean) +.RS 4 +如果 uid 和 gid 相同,用户名和主用户名也相同,使非 root 组的组掩码位和属主位相同 (如:022 \-> 002, 077 \-> 007)。 +.sp +如果设置为 +\fIyes\fR,如果组中没有成员了,\fBuserdel\fR +将移除此用户组,\fBuseradd\fR +创建用户时,也会创建一个同名的默认组。 +.RE +.SH "文件" +.PP +/var/run/utmp +.RS 4 +当前登录会话的列表。 +.RE +.PP +/var/log/wtmp +.RS 4 +先前的登录会话列表。 +.RE +.PP +/etc/passwd +.RS 4 +用户账户信息。 +.RE +.PP +/etc/shadow +.RS 4 +安全用户账户信息。 +.RE +.PP +/etc/motd +.RS 4 +System message of the day file\&. +.RE +.PP +/etc/nologin +.RS 4 +阻止非 root 用户登录。 +.RE +.PP +/etc/ttytype +.RS 4 +终端类型列表。 +.RE +.PP +$HOME/\&.hushlogin +.RS 4 +阻止现实系统信息。 +.RE +.PP +/etc/login\&.defs +.RS 4 +Shadow 密码套件配置。 +.RE +.SH "参见" +.PP +\fBmail\fR(1), +\fBpasswd\fR(1), +\fBsh\fR(1), +\fBsu\fR(1), +\fBlogin.defs\fR(5), +\fBnologin\fR(5), +\fBpasswd\fR(5), +\fBsecuretty\fR(5), +\fBgetty\fR(8)\&. |