WebSphere Automation 的 SSH 设置为 Windows 服务器

要应用安全修订或从受管服务器收集堆转储信息,必须正确配置 WebSphere Automation 和服务器以使用 SSH 进行通信。 配置 WebSphere Automation 以将 SSH 与 Windows 服务器配合使用。

准备工作

确保要管理的服务器符合托管服务器要求中的先决条件。

关于本任务

必须使用 SSH 密钥、用户和其他必需连接参数配置 WebSphere Automation 以远程访问 WebSphere Application ServerWebSphere Application Server Liberty 服务器。 使用 SSH 设置 WebSphere Application Server 以访问 Windows 服务器类似于WebSphere Application Server 的 SSH 设置为 Linux 和 Unix 服务器

过程

  1. 使用 SSH 连接参数在 WebSphere Automation 名称空间中创建 wsa-ansible-win 私钥:
    oc create secret generic wsa-ansible-win \
       --from-literal=ansible_user=<ssh_username> \
       --from-literal=ansible_port=<ssh_port> \
       --from-file=ssh_private_key_file=<ssh_private_key_file> \
       --from-literal=ssh_private_key_password=<ssh_private_key_passphrase> \
       --from-literal=ansible_shell_type=<shell> \
       --from-literal=ansible_python_interpreter=<path_to_python>

    请参阅以下示例。

    oc create secret generic wsa-ansible-win \
       --from-literal=ansible_user=wsadmin \
       --from-literal=ansible_port=22 \
       --from-file=ssh_private_key_file=/home/admin/.ssh/wsa \
       --from-literal=ssh_private_key_password=changeme \
       --from-literal=ansible_shell_type=powershell \
       --from-literal=ansible_python_interpreter='C:\Program Files\Python39\python'

    如果 SSH 专用密钥未加密,那么不需要 ssh_private_key_password 参数。 其他连接参数也可以以相同的方式传递。 ansible_shell_type 参数反映 Windows 服务器上配置的 DefaultShell 设置。 如果 DefaultShell 设置为 PowerShell,请将值设置为 powershell;否则,将其设置为 cmd。 其他连接参数也可以以相同的方式配置。 完整参数列表请参见 Ansible 文档 外部链接图标

    如果目标机器上的 Python 可执行文件不在系统路径中,或者未命名为 pythonpython3,那么必须在创建私钥期间添加 ansible_python_interpreter 参数。

  2. 使用 " 为 Linux 和 Unix 服务器的 SSH 设置 WebSphere Application Server " 中的步骤 2,设置已知 Windows 主机列表。