lssecurity

使用 lssecurity 命令来显示当前系统安全套接字层 (SSL) 或传输层安全性 (TLS) 安全设置。

语法

读取语法图跳过可视语法图 lssecurity -nohdr-delim定界符

参数

-nohdr
(可选)缺省情况下,在简洁样式视图中为每列数据显示标题,在详细样式视图中为每个数据项显示标题。 -nohdr 参数阻止显示这些标题。
注: 如果不存在要显示的数据,那么不会显示标题。
-delim 定界符
(可选)缺省情况下,在简明视图中,所有数据列都是空格分隔的。 每列的宽度设置为每个数据项的最大宽度。 在详细视图中,每个数据项各占一行,如果显示标题,将用空格来分隔数据与标题。 -delim 参数覆盖此行为。 -delim 参数的有效输入是 1 字节字符。 如果在命令行上输入 -delim : ,那么在简明视图中将用冒号字符 (:) 分隔所有数据项; 例如,不会出现列间距。 在详细视图中,数据以指定的定界符与标题分隔。

描述

此命令显示系统范围的当前系统安全设置,包括 SSL 或 TLS 和 SSH 安全级别。

此表提供了对 lssecurity 命令显示的可能的值。

表 1. lssecurity 属性值
属性
sslprotocol 指定当前安全级别设置 (数字值 25)。
使用以下 sslprotocol 安全级别设置。
  • 2 -允许 TLS 1.2,但不允许 TLS 1.0 和 TLS 1.1。
  • 3 -还不允许非 1.2独有的 TLS 1.2 密码套件。
  • 4 -另外不允许 RSA 密钥交换密码和静态密钥交换密码。
  • 5 (兼容性方式)- 初始允许 TLS 1.3,这是首选的连接方法。 如果 TLS 1.3 失败,那么 TLS 1.2 将用于连接。
sshprotocol 指定 SSH 的当前安全级别,为数字值 12
使用以下 sshprotocol 安全级别设置。
  • 1 允许以下密钥交换方法。
    • curve25519-sha256
    • curve25519-sha256@libssh.org
    • ecdh-sha2-nistp256
    • ecdh-sha2-nistp384
    • ecdh-sha2-nistp521
    • diffie-hellman-group-exchange-sha256
    • diffie-hellman-group16-sha512
    • diffie-hellman-group18-sha512
    • diffie-hellman-group14-sha256
    • diffie-hellman-group14-sha1
    • diffie-hellman-group1-sha1
    • diffie-hellman-group-exchange-sha1
  • 2 允许以下密钥交换方法。
    • curve25519-sha256
    • curve25519-sha256@libssh.org
    • ecdh-sha2-nistp256
    • ecdh-sha2-nistp384
    • ecdh-sha2-nistp521
    • diffie-hellman-group-exchange-sha256
    • diffie-hellman-group16-sha512
    • diffie-hellman-group18-sha512
    • diffie-hellman-group14-sha256
    • diffie-hellman-group14-sha1
  • 3 允许以下密钥交换方法:
    • curve25519-sha256
    • curve25519-sha256@libssh.org
    • ecdh-sha2-nistp256
    • ecdh-sha2-nistp384
    • ecdh-sha2-nistp521
    • diffie-hellman-group-exchange-sha256
    • diffie-hellman-group16-sha512
    • diffie-hellman-group18-sha512
    • diffie-hellman-group14-sha256
gui_timeout_mins 指定浏览器会话到期前的不活动分钟数。 值为 5 到 240 之间的数字。
cli_timeout_mins 指定 SSH 会话到期前的不活动分钟数。 值为 5 到 240 之间的数字。
min_password_length 指定新密码中所需的最少字符数。 值为 6 到 64 之间的数字。
password_special_chars 指定系统上创建的所有新密码中所需的最少特殊字符数。 值为 0 意味着无需任何特殊字符。 值为 0 到 3 之间的数字。
password_upper_case 指定系统上创建的所有新密码中所需的最少大写字符数。 值为 0 意味着无需任何大写字符。 值为 0 到 3 之间的数字。
password_lower_case 指定系统上创建的所有新密码中所需的最少小写字符数。 值为 0 意味着无需任何小写字符。 值为 0 到 3 之间的数字。
password_digits 指定系统上创建的所有新密码中所需的最少数字位数。 值为 0 意味着无需任何数字。 值为 0 到 3 之间的数字。
check_password_history 指定是否检查密码历史记录以阻止用户复用先前的密码。 值为 yes 或 no。
max_password_history 指定在启用 checkpasswordhistory 的情况下要比较的先前密码数。 值为 0 意味着新密码仅与当前密码进行比较。 值为 6 到 10 之间的数字。
min_password_age_days 指定密码更改间隔的最短天数。 如果启用了 checkpasswordhistory,那么将实施此设置。 值为 0 到 365 之间的数字。
password_expiry_days 指定密码到期且必须进行更改之前的天数。 值为 0 到 365 之间的数字。
expiry_warning_days 指定密码到期之前在用户登录时发出警告的天数。 值为 0 到 30 之间的数字。
lockout_period_mins 指定在失败认证尝试次数超过 max_failed_logins 值时用户被锁定的分钟数。 值为 0 到 10080 之间的数字。
max_failed_login_attempts 指定导致帐户被锁定的失败登录次数。 值为 0 到 10 之间的数字。
superuser_locking 指定是否对超级用户应用系统上的用户锁定策略。 值为 enableddisabled
restapi_timeout_mins 指定 RESTful API 令牌到期前活动的总分钟数。 值必须在 10 到 120 范围内。
ssh_grace_time_seconds 指定 SSHD 配置中 LoginGraceTime 字段的值。 该值在 15-1800 范围内。
ssh_max_tries 指定 SSHD 配置中 LoginGrace时间设置的值。 值必须在 1 到 10 范围内。
superuser_multi_factor 指定是否为超级用户启用多因子认证。 值为 yesno
superuser_password_sshkey_required 指定超级用户在认证期间是否应同时提供密码和 SSH 公用密钥。 值为 yesno
superuser_gui_disabled 指定是否对超级用户禁用 GUI 访问。 值为 yesno
superuser_rest_disabled 指定是否对超级用户禁用 REST-API 访问。 值为 yesno
superuser_cim_disabled 指定是否对超级用户禁用 CIMOM 访问。 值为 yesno
ssl_protocols_enabled 指定当前启用的 SSL 协议安全级别支持的 TLS 协议版本。
建议的ssl_protocol_处 指定系统是否自动遵循建议的 SSL 协议级别。
建议的ssh_protocol_建议 指定系统是否自动遵循建议的 SSH 协议级别。

调用示例

lssecurity

生成的输出

sslprotocol 3
sshprotocol 1
gui_timeout_mins 30
cli_timeout_mins 15
restapi_timeout_mins 60
min_password_length 8
password_special_chars 0
password_upper_case 0
password_lower_case 0
password_digits 0
check_password_history no
max_password_history 6
min_password_age_days 1
password_expiry_days 0
expiry_warning_days 14
superuser_locking enabled
max_failed_login_attempts 10
lockout_period_mins 1
superuser_multi_factor yes
ssh_grace_time_seconds 900
ssh_max_tries 3
superuser_password_sshkey_required no
superuser_gui_disabled no
superuser_rest_disabled yes
superuser_cim_disabled yes

ssl_protocols_enabled TLSv1.2:TLSv1.3
ssl_protocol_suggested yes
ssh_protocol_suggested yes