Linux系統命令login的翻譯

LOGIN(1)                                用戶命令                               LOGIN(1)

名稱
       login - 在系統上啟動回話

大綱
       login [-p] [-h 主機] [用戶名] [ENV=VAR...]

       login [-p] [-h 主機] -f 用戶名

       login [-p] -r 主機

描述
       The login program is used to establish a new session with the system.It is normally invoked automatically by responding to the login:prompt on the user's terminal.login may be special to the shell and may not be invoked as a sub-process.When called from a shell, login should be executed as exec login 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 login from any shell but the login shell will produce an error message.
       login程式被用於建立新的系統會話。它通常通過響應login自動調用,提示用戶終端。login 可能是shell特有的並且不能被作為子進程調用。當從shell調用時,login應該作為exec login執行,這將導致用戶退出當前shell(從而阻止新登錄的用戶返回調用方的會話)。嘗試從任何shell執行login但是login shell將產生一個錯誤資訊。

       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 login exits and the communications link is severed.
       然後在適當的情況下提示用戶輸入密碼。已禁用回顯以防止泄漏密碼。在退出登錄並切斷通訊鏈路之前,只允許少量密碼失敗。
       
       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 passwd(1) for more information.
       如果已為您的賬戶啟用密碼老化,則可能會提示您在繼續之前輸入新密碼。在繼續之前,您將被迫提供舊密碼和新密碼。有關更多資訊,請參閱passwd(1)。

       Your user and group ID will be set according to their values in the /etc/passwd file. The value for $HOME, $SHELL, $PATH, $LOGNAME, and $MAIL 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.
       您的用戶和組ID將根據/etc/passwd文件中的值進行設置。$HOME、$SHELL、$PATH、$LOGNAME和$MAIL的值是根據密碼條目中的相應欄位設置的。Ulimit、umask和nice值也可以根據GECOS欄位中的條目進行設置。

       On some installations, the environmental variable $TERM will be initialized to the terminal type on your tty line, as specified in /etc/ttytype.
       在某些安裝中,環境變數$TERM將初始化為tty行上的終端類型,如/etc/ttytype中指定的那樣。

       命令解釋器的初始化腳本也可能執行。請參考手冊中相應的章節來獲取關於此功能的更多資訊。

       在登錄 shell中以第一個字元是「*」標註的是子系統登錄。給定的主目錄將被用於用戶實際登錄的新文件系統的根。

       The login program is NOT responsible for removing users from the utmp file. It is the responsibility of getty(8) and init(8) to clean up apparent ownership of a terminal session. If you use login from the shell prompt without exec, the user you use will continue to appear to be logged in even after you log out of the "subsession".
       登錄程式不負責從utmp文件中刪除用戶。getty(8)和init(8)負責清除終端會話的明顯所有權。如果您在沒有exec的情況下從shell提示符使用login,那麼即使您從「subsession」註銷,您使用的用戶仍將繼續顯示為已登錄。

選項
       -f
           不要執行認證,用戶已經預認證過。

           注意:此時,username 是強制的。

       -h
           此登錄的遠程主機名。

       -p
           保留環境。

       -r
           為 rlogin (遠程登錄)執行 autologin (自動登錄)協議。

       -r, -h and -f 只能用於 root 使用 login 時。

CAVEATS
注意事項
       此版本的 login 有很多編譯選項,只有一部分可以在任何站點使用。

       文件的位置由系統配置決定。

       The login program is NOT responsible for removing users from the utmp file.
       It is the responsibility of getty(8) and init(8) to clean up apparent ownership of a terminal session.
       If you use login from the shell prompt without exec, the user you use will continue to appear to be logged in even after you log out of the "subsession".

       As with any program, login's 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.
       與任何程式一樣,登錄名的外觀都可能是偽造的。 如果不受信任的用戶可以物理訪問某台電腦,則攻擊者可以利用此許可權獲取下一個坐在該電腦前面的人的密碼。

配置文件
       在 /etc/login.defs 中有如下配置變數,可以用來更改此工具的行為:

       CONSOLE_GROUPS (string)
           在控制台登錄時,添加到用戶附加組集中的組列表(就如 CONSOLE 所確定的)。默認是無。
           使用時需要注意:這可能使用戶獲取這些組的永久許可權,甚至登錄到的不是此控制台時。

       DEFAULT_HOME (boolean)
           如果不能 cd 到主目錄時,說明是否允許登錄。默認是否。

           如果設置為 yes,如果不能 cd 到主目錄時,用戶將會登錄到根目錄(/)。

       ENV_PATH (string)
           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 /bin:/usr/bin) and can be preceded by PATH=. The default value is PATH=/bin:/usr/bin.
           如果設置了,它將用於定義常規用戶登陸時的PATH環境變數。該值是以冒號分隔的路徑列表(例如/bin:/usr/bin),前面可以是PATH=。默認值為PATH=/bin:/usr/bin。


       ENV_SUPATH (string)
           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 /sbin:/bin:/usr/sbin:/usr/bin) and can be preceded by PATH=. The default value is PATH=/sbin:/bin:/usr/sbin:/usr/bin.
           如果設置,它將用於定義超級用戶登錄時的PATH環境變數。該值是以冒號分隔的路徑列表(例如/sbin:/bin:/usr/sbin:/usr/bin),前面可以是PATH=。默認值為PATH=/sbin:/bin:/usr/sbin:/usr/bin。

       ERASECHAR (number)
           終端擦除字元 (010 = backspace, 0177 = DEL)。

           此值可以使用前綴「0」表示八進位,「0x」表示十六進位。

       FAIL_DELAY (number)
           登錄失敗後,等待多少秒才再允許登錄。

       FAKE_SHELL (string)
           如果設置了,login 將執行此 shell 而不是在 /etc/passwd 中指定的用戶 shell。

       HUSHLOGIN_FILE (string)
           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's 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's home directory.
           如果定義了,該文件可以在登錄序列期間抑制所有常見的抖動。如果指定了完整路徑名,則如果在文件中找到用戶名或shell,則將啟用靜默模式。如果不是完整路徑名,則如果文件存在於用戶的主目錄中,將啟用靜默模式。

       KILLCHAR (number)
           終端 KILL 字元 (025 = CTRL/U)。

           此值可以使用前綴「0」表示八進位,「0x」表示十六進位。

       LOGIN_RETRIES (number)
           密碼錯誤時,重試的最大次數。

           This will most likely be overridden by PAM, since the default pam_unix module has its own built in of 3 retries. However, this is a safe fallback in case you are using an authentication module that does not enforce PAM_MAXTRIES.
           這很可能會被PAM覆蓋,因為默認的pam_unix模組有自己的內置3次重試。但是,如果您使用的驗證模組不強制PAM_MAXTRIES,這是一種安全的回退。

       LOGIN_TIMEOUT (number)
           最大登錄時間(以秒為單位)。

       LOG_OK_LOGINS (boolean)
           允許記錄成功登錄。

       LOG_UNKFAIL_ENAB (boolean)
           在記錄到登錄失敗時,允許記錄未知用戶名。

           注意:如果用戶不小心將密碼輸入到了登錄名中,記錄未知用戶名可能是一個安全隱患。

       TTYGROUP (string), TTYPERM (string)
           The terminal permissions: the login tty will be owned by the TTYGROUP group, and the permissions will be set to TTYPERM. By default, the ownership of the terminal is set to the user's primary group and the permissions are set to 0600. TTYGROUP can be either the name of a group or a numeric group identifier. If you have a write 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.
           終端permissions:login tty將由TTYGROUP組擁有,許可權將設置為TTYPERM。默認情況下,終端的所有權設置為用戶的主要組,許可權設置為0600。如果您有一個寫入程式,它是「setgid」到一個擁有終端的特殊組,那麼將TTYGROUP定義為組號,將TTYPERM定義為0620。否則,將TTYGROUP保留為注釋掉,並將TTYPERM指定給622或600。

       TTYTYPE_FILE (string)
           If defined, file which maps tty line to TERM environment parameter. Each line of the file is in a format something like "vt100 tty01".
           如果已定義,將tty行映射到TERM環境參數的文件。文件的每一行的格式類似於「vt100 tty01」。

       USERGROUPS_ENAB (boolean)
           如果設置為 yes,如果組中沒有成員了,userdel 將移除此用戶組,useradd
           創建用戶時,也會創建一個同名的默認組。

文件
       /var/run/utmp
           當前登錄會話的列表。

       /var/log/wtmp
           先前的登錄會話列表。

       /etc/passwd
           用戶賬戶資訊。

       /etc/shadow
           安全用戶賬戶資訊。

       /etc/motd
           System message of the day file.

       /etc/nologin
           阻止非 root 用戶登錄。

       /etc/ttytype
           終端類型列表。

       $HOME/.hushlogin
           阻止現實系統資訊。

       /etc/login.defs
           Shadow 密碼套件配置。

參閱
       mail(1), passwd(1), sh(1), su(1), login.defs(5), nologin(5), passwd(5),
       securetty(5), getty(8).

shadow-utils 4.2                       2019-03-26                              LOGIN(1)