logins - 列出用户和系统登录信息
/usr/bin/logins [-S repository] [-admoprstux] [-g group...] [-l login_name...]
This command displays information on user, role, and system login accounts known to the system.Contents of the output is controlled by the command options and can include the following: user, role, or system login; user id number; passwd account field value (user name or other information); primary group name; primary group id; multiple group names; multiple group ids; home directory; login shell; and four password-aging parameters.缺省信息如下:登录 ID、用户 ID、主组名称、主组 ID 以及帐户字段值。除非指定了 –t 选项,否则输出按用户 ID 排序。–S 选项将登录搜索限定到指定的名称服务系统信息库。See nsswitch.conf(5).
选项可以一起使用。如果一起使用,则将显示匹配任何条件的所有登录。
支持以下选项:
在显示中添加两个口令到期字段。这两个字段显示口令在自动失效之前保持未使用状态的天数以及口令失效的日期。
选择具有重复的 uid 的登录。
选择属于 group 的所有用户,按登录排序。可以逗号分隔的列表形式指定多个组。当结合使用 –l 和 –g 选项时,则即使用户属于多个选定的组,一个用户也仅列出一次。
选择请求的登录。可以逗号分隔的列表形式指定多个登录。Unless the –S option is specified, the lookup depends on the nameservice lookup types set in nsswitch.conf(5), the information can come from the /etc/passwd and /etc/shadow files and other nameservices.当结合使用 –l 和 –g 选项时,则即使用户属于多个选定的组,一个用户也仅列出一次。
Select logins only from an available name service database repository.
显示多个组成员关系信息。
将输出格式设置为一行冒号分隔的字段。
选择没有口令的登录。
选择所有角色登录。
选择所有系统登录。
按登录(而不是 uid)对输出排序。
选择所有用户登录。
列显有关每个选定用户的扩展信息集。扩展的信息包括起始目录、登录 shell 以及口令生命期信息,每种信息在单独的行上显示。口令信息当前包含口令状态:
帐户没有口令
帐户已锁定进行 UNIX 验证
由于超过了配置的验证失败次数而自动锁定了帐户。
帐户是无登录帐户
管理员尚未激活帐户,因此无法使用。
帐户可能有一个有效的口令
帐户口令状态未知。也就是说,它不是一个可识别的散列口令或上述各项中的任何一个。请参见 crypt(3C) 了解有效的口令散列。
如果登录有口令,则状态会后跟上次更改口令的日期、两次更改之间所需的天数以及需要更改之前允许的天数。口令生命期信息显示在口令到期之前用户(在登录时)收到口令到期警告消息的时间间隔。
有关下列属性的说明,请参见 attributes(7):
|
groups(1), passwd(1), roles(1), crypt(3C), nsswitch.conf(5), passwd(5), shadow(5), rbac(7), attributes(7)