chsecurity

使用 chsecurity 命令可更改系统的安全套接字层 (SSL)、安全 Shell (SSH) 或传输层安全性 (TLS) 安全设置。

语法

chsecurity { -sslprotocolsecurity_level | -sshprotocolsecurity_level }

参数

Remember: 这些参数是互斥的。 您必须指定 -sslprotocol-sshprotocol 中的一个,但不能同时指定。
-sslprotocolsecurity_level
(必需)指定 SSL 安全级别设置的数字值,这可以是 14 之间的任何值。3 为缺省设置值。
安全级别设置:
  • 1 不允许使用 SSL 3.0。
  • 2 只允许使用 TLS 1.2。
  • 3 另外不允许使用并非专用于 1.2 的 TLS 1.2 密码套件。
  • 4 另外不允许 RSA 密钥交换密码。
-sshprotocolsecurity_level
(必需)指定 SSH 安全级别设置的数字值,这可以是 121 是缺省设置值。
安全级别设置:
  • 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

描述

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

调用示例

chsecurity -sslprotocol 4

生成的输出:

Changing the SSL security level could disable the GUI connection on old web browsers, 
and changing the SSH security level may logout existing SSH sessions. Are you sure you wish to continue? (y/yes to confirm)

调用示例

chsecurity -sshprotocol 2

生成的输出:

Changing the SSL security level could disable the GUI connection on old web browsers, 
and changing the SSH security level may logout existing SSH sessions. Are you sure you wish to continue? (y/yes to confirm)