【问题标题】:ansible - Connection timed out during banner exchange when Using jump hostansible - 使用跳转主机时在横幅交换期间连接超时
【发布时间】:2021-11-04 18:20:58
【问题描述】:

ansible 命令:ansible all -m ping -i host.yml

这是我的 host.yml

---
all:
  hosts:
    tencent:
      ansible_user: "ubuntu"
      ansible_host: "106.55.XXX.XXX"
      ansible_ssh_private_key_file: "key.pem"
      ansible_ssh_common_args: 'ssh -o ProxyCommand="ssh -i bastion.key.pem ubuntu@102.106.XXX.XXX"'

错误信息:

Failed to connect to the host via ssh: Connection timed out during banner exchange

ansible中如何正确使用跳转主机?

【问题讨论】:

    标签: ansible bastion-host


    【解决方案1】:

    这是一个可靠的解决方案:

    How do I configure a jump host to access servers that I have no direct access to?

    就我而言,只需替换 ansible_ssh_common_args

    ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q ubuntu@102.106.XXX.XXX -i ./inventory/bastion.key.pem"'
    

    【讨论】:

      猜你喜欢
      • 2019-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 2020-08-29
      • 2013-11-22
      • 1970-01-01
      相关资源
      最近更新 更多