强化 SSH - BlueCat Integrity - 9.5.0

管理指南

Locale
中文 (大陆)
Product name
BlueCat Integrity
Version
9.5.0

从 Address Manager v9.5.0 和 DNS/DHCP 服务器 v9.5.0 开始,Address Manager 和 DNS/DHCP 服务器中都添加了用于强化 SSH 服务的脚本。运行强化脚本将从 SSH 客户端和守护程序配置中删除弱算法,从而防止使用弱算法。

注意: 在用户希望强化 SSH 的所有 Address Manager v9.5.0 和 DNS/DHCP 服务器上,都必须手动运行该脚本。对于新的 v9.5.0 服务器或升级到 v9.5.0 的服务器,默认情况下强化 SSH。
注意: 在创建信任关系时,Address Manager v9.4.x 服务器和更早版本使用的 SSH 算法在启用强化 SSH 的情况下不再有效。对于已经升级到 v9.5.0 并保持已建立信任关系的服务器,必须在运行 SSH 强化脚本之前刷新信任关系中的 SSH 密钥。这将在信任关系中的所有 Address Manager 服务器之间生成并传输对强化 SSH (ed25519) 有效的新密钥。有关刷新信任关系中的 SSH 密钥的更多信息,请参阅 刷新信任关系中的 Address Manager 密钥。刷新密钥后,按下述方式分别在每个 Address Manager 服务器上执行 SSH 强化。

要在 Address Manager 或 DNS/DHCP 服务器上强化 SSH:

  1. 以 root 身份登录 Address Manager 或 DNS/DHCP 服务器管理控制台。
    注: 有关 root 凭证的更多信息,请参阅 设置 root 密码
  2. 运行 harden_ssh.sh 脚本。可以在 Address Manager 和 DNS/DHCP 服务器设备的以下位置找到该脚本:
    /usr/local/bluecat/harden_ssh.sh
  3. 控制台会向用户显示警告提示。
    $ ./harden_ssh.sh
    
    *** WARNING ***
    Running this script results in a restart of the SSH daemon.
    Any active SSH connections will be terminated!
    
    Reconnect via SSH after completion of this script to verify
    that the contents of the following files are uncommented:
    - /etc/ssh/sshd_config.d/bluecat_hardened_ssh.conf
    - /etc/ssh/ssh_config.d/bluecat_hardened_ssh.conf
    
    Do you want to proceed? (y/n)          
    Enter y to continue.如果您是通过 SSH 建立的远程连接,则会话将终止。

  4. 如果您是通过 SSH 建立的连接,请重新建立与 Address Manager 或 DNS/DHCP 服务器的连接。请验证并确认以下文件的内容未被注释掉:
    /etc/ssh/sshd_config.d/bluecat_hardened_ssh.conf
    /etc/ssh/ssh_config.d/bluecat_hardened_ssh.conf

弱化 SSH(撤消强化 SSH 更改)

使用 weaken_ssh.sh 脚本执行上述过程,可以轻松撤消 SSH 强化更改。可以在 Address Manager 和 DNS/DHCP 服务器设备的以下位置找到该脚本:
/usr/local/bluecat/weaken_ssh.sh
与上述步骤相同,您将在继续之前收到警告提示。输入 y 以运行脚本,并根据需要重新建立与控制台的连接,然后验证并确认以下文件的内容已被注释掉:
/etc/ssh/sshd_config.d/bluecat_hardened_ssh.conf
/etc/ssh/ssh_config.d/bluecat_hardened_ssh.conf