chsecurity

使用 chsecurity 命令可更改系统的安全设置。

语法

读取语法图跳过可视语法图 chsecurity -sslprotocol安全级别-sshprotocol安全级别-guitimeoutgui_timeout_mins-clitimeoutcli_timeout_mins-minpasswordlengthmin_password_length-passwordspecialcharspassword_special_chars-passworduppercasepassword_upper_case-passwordlowercasepassword_lower_case-passworddigits密码数字-checkpasswordhistory-maxpasswordhistorymax_password_history-minpasswordagemin_password_age_days-passwordexpirypassword_expiry_days-expirywarningexpiry_warning_days-superuserlocking启用禁用-maxfailedloginsmax_failed_login_attempts-lockoutperiodlockout_period _mins-resetpolicy-restapitimeout超时分钟数-superusermultifactor-sshmaxtries (1-10)-sshgracetime (15-1800)-superuserpasswordkeyrequired-disablesuperusergui-disablesuperuserrest

参数

-sslprotocol security_level
(必需) 指定 SSL 安全级别设置的数字值,该值可以采用从 14的任何值。 设置 3 是缺省值。
使用以下 sslprotocol 安全级别设置:
  • 1 -允许 TLS 1.0, TLS 1.1和 TLS 1.2,但不允许 SSL 3.0。
  • 2 -允许 TLS 1.2,但不允许 TLS 1.0 和 TLS 1.1。
  • 3 -另外不允许非 1.2独占的 TLS 1.2 密码套件。
  • 4 -另外不允许 RSA 密钥交换密码和静态密钥交换密码。
此参数无法与任何其他参数配合运行。

更改 SSL 安全级别可能会禁用较旧的 Web 浏览器上的 GUI 连接。 如果连接丢失,请使用 CLI 提示将安全级别更改回已知的正常级别。

-sshprotocol security_level
(必需) 指定 SSH 安全级别设置的数字值,该值可以采用 13的值。 设置 3 是缺省值。
使用以下 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
此参数无法与任何其他参数配合运行。
-guitimeout gui_timeout_mins
(可选)指定会话到期之前的时间量(以分钟为单位),并且用户由于没有活动而注销了 GUI。 值必须为范围在 5 到 240 之间的整数。
-clitimeout cli_timeout_mins
(可选)指定会话到期之前的时间量(以分钟为单位),并且用户由于没有活动而注销了 CLI。 值必须为范围在 5 到 240 之间的整数。
-minpasswordlength min_password_length
(可选)指定系统上用户帐户密码的最小长度需求。 值必须为范围在 6 到 64 之间的整数。
-passwordspecialchars password_special_chars
(可选)指定本地用户的密码中需要的特殊字符数。 值为 0 意味着无需任何特殊字符。 值必须为范围在 0 到 3 之间的整数。
-passworduppercase password_upper_case
(可选)指定本地用户的密码中需要的大写字符数。 值为 0 意味着无需任何大写字符。 值必须为范围在 0 到 3 之间的整数。
-passwordlowercase password_lower_case
(可选)指定本地用户的密码中需要的小写字符数。 值为 0 意味着无需任何小写字符。 值必须为范围在 0 到 3 之间的整数。
-passworddigits 密码数字
(可选)指定本地用户的密码中需要的数字位数。 值为 0 意味着无需任何数字。 值必须为范围在 0 到 3 之间的整数。
-checkpasswordhistory 是 | 否
(可选)指定系统是否阻止用户复用先前的密码。 值为 yesno

此参数在 FlashSystem 5010 , FlashSystem 5015 , FlashSystem 5030 和 FlashSystem 5035 上不受支持。

-maxpasswordhistory max_password_history
(可选)指定在启用 checkpasswordhistory 的情况下要比较的先前密码数。 值为 0 意味着新密码仅与当前密码进行比较。 值必须为范围在 0 到 10 之间的整数。
-minpasswordage min_password_age_days
(可选)指定密码更改间隔的最短天数。 如果启用了 checkpasswordhistory,那么将实施此设置。 如果密码已到期,那么将忽略此限制。 如果该值大于 passwordexpiry 值,那么此设置无效。 值必须为范围在 0 到 365 之间的整数。
-passwordexpiry password_expiry_days
(可选)指定密码到期之前的天数。 值为 0 意味着该功能已禁用,并且密码不会到期。 值必须为范围在 0 到 365 之间的整数。
-expirywarning expiry_warning_days
(可选)指定在密码到期之前提前发出警告的天数。 每次登录 CLI 时都会显示警告,直至更改密码为止。 值为 0 意味着该功能已禁用,并且不会显示警告。 值必须为范围在 0 到 30 之间的整数。
-superuserlocking enable | disable
(可选)指定系统上配置的锁定策略是否也适用于超级用户。 值为 enabledisable。 此参数仅在具有专用技术人员端口的系统上受支持。
-maxfailedlogins max_failed_login_attempts
(可选)指定在 lockoutperiod 所指定的时间段内锁定用户帐户之前失败的登录尝试次数。 值为 0 意味着该功能已禁用,并且登录尝试失败后未锁定帐户。 值必须为范围在 0 到 10 之间的整数。
-lockoutperiod lockout_period_mins
(可选)指定在达到最大失败登录次数值时将用户锁定的分钟数。 值为 0 意味着在达到最大失败登录尝试次数时无限期锁定用户。 值必须为范围在 0 到 10080 之间的整数。
-resetpolicy
(可选)将所有安全设置重置为其缺省值。 将显示 yes / no 警告提示以确认操作。 此参数无法与任何其他参数配合运行。
-restapitimeout
(可选)指定令牌到期前的时间量(以分钟计)。 值必须在 10 到 120 范围内。
-superusermultifactor 是 | 否
(可选) 指定是否应提示超级用户进行多因子认证。 值为 yesno
-sshmaxtries
(可选) 指定每个 SSH 连接允许的登录尝试次数。 值必须在 1 到 10 范围内。
-sshgracetime
(可选) 指定用户在终止连接之前必须输入每个 SSH 连接的登录因子的持续时间。 值为 15 秒到 1800 秒范围内的秒数。
-superuserpasswordkeyrequired
(可选) 指定超级用户是否必须同时提供密码和 SSH 密钥以进行认证。 值为 yesno
-disablesuperusergui
(可选) 指定是否必须对超级用户禁用 GUI 访问。 值为 yesno
-disablesuperuserrest
(可选) 指定是否必须对超级用户禁用 REST API 访问。 值为 yesno

描述

此命令更改系统上的安全设置。
重要信息: 如果使用 SSL 或 TLS ,那么更改安全性可能会中断这些服务。
如果发生中断,请使用此过程。
  1. 等待 5 分钟,然后重试。 (等待所有服务重新启动。)
  2. 确认 SSL 或 TLS 实施为最新实施且支持所指定的安全级别。
  3. 如有必要,请还原为较低版本的 SSL 或 TLS 安全性。

调用示例

chsecurity -superusermultifactor yes

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter.
Are you sure you wish to continue? (y/yes to confirm) y 

调用示例

lsservicestatus | grep superuser

生成的输出

superuser_locked no
superuser_multi_factor yes
superuser_password_sshkey_required no
superuser_gui_disabled no
superuser_rest_disabled no
 

调用示例

chsecurity -sshgracetime 900

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter.
 Are you sure you wish to continue? (y/yes to confirm) y 

调用示例

lssecurity | grep grace

生成的输出

ssh_grace_time_seconds 900

调用示例

chsecurity -sshmaxtries 3

生成的输出

No feedback.

调用示例

lssecurity | grep max_tries

生成的输出

ssh_max_tries 3

调用示例

chsecurity -superuserpasswordkeyrequired yes

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter.
 Are you sure you wish to continue? (y/yes to confirm)  y

调用示例

lsservicestatus | grep superuser

生成的输出

superuser_locked no
superuser_multi_factor no
superuser_password_sshkey_required yes
superuser_gui_disabled no
superuser_rest_disabled no

调用示例

chsecurity -disablesuperuserrest yes

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter.
 Are you sure you wish to continue? (y/yes to confirm)  y

调用示例

lsservicestatus | grep superuser

生成的输出

superuser_locked no
superuser_multi_factor no
superuser_password_sshkey_required no
superuser_gui_disabled no
superuser_rest_disabled yes

调用示例

chsecurity -sslprotocol 4

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI.
 Refer to the Command Line Interface help for more information about the risks associated with each parameter. Are you sure you wish to continue? (y/yes to confirm)

调用示例

chsecurity -sshprotocol 2

生成的输出

Changing the system security settings could result in a loss of access to the system via SSH or the management GUI.
 Refer to the Command Line Interface help for more information about the risks associated with each parameter. Are you sure you wish to continue? (y/yes to confirm)

调用示例

chsecurity -minpasswordlength 12
No feedback.


chsecurity -guitimeout 60
No feedback.


chsecurity -clitimeout 60
No feedback.


chsecurity -superuserlocking enable
Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter. Are you sure you wish to continue? (y/yes to confirm)


chsecurity -maxfailedlogins 4
No feedback.


chsecurity -lockoutperiod 60
No feedback.

chsecurity -lockoutperiod 0
No feedback.

chsecurity -passwordexpiry 90
No feedback.

chsecurity -passwordexpiry 60 -expirywarning 14
No feedback.

chsecurity -checkpasswordhistory yes
No feedback.

chsecurity -maxpasswordhistory 3
No feedback.

chsecurity -minpasswordage 1
No feedback.



svctask chsecurity -passwordspecialchars 0
No feedback.

svctask chsecurity -passworddigits 1
No feedback.

svctask chsecurity -passwordlowercase 2
No feedback.

svctask chsecurity -passworduppercase 3
No feedback.



chsecurity -resetpolicy
Changing the system security settings could result in a loss of access to the system via SSH or the management GUI. Refer to the Command Line Interface help for more information about the risks associated with each parameter. Are you sure you wish to continue? (y/yes to confirm)