- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
遵循本指南(和其他)running-ansible-through-ssh-bastion-host .
我设置了 ssh.cfg 文件以允许连接到多个堡垒后面的主机。
代理 -> 实用程序 -> 监视器 -> 更多
我可以连接到 util 服务器:
[self@home]$ ssh -F ssh.cfg util
...
[self@util]$
和监控服务器:
[self@home]$ ssh -F ssh.cfg monitor
...
[self@monitor]$
ssh.conf:
Host *
ServerAliveInterval 60
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 15m
Host proxy
HostName proxy01.com
ForwardAgent yes
Host util
HostName util01.priv
ProxyCommand ssh -W %h:%p proxy
Host monitor
HostName mon01.priv
ProxyCommand ssh -W %h:%p util
[bastion]
proxy
[utility]
util
monitor
[ssh_connection]
ssh_args = -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=15m
control_path = ~/.ssh/ansible-%%r@%%h:%%p
> ansible all -a "/bin/echo hello"
util | UNREACHABLE! => {
"changed": false,
"msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh",
"unreachable": true
}
proxy | SUCCESS | rc=0 >>
hello
monitor | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
util | UNREACHABLE! => {
"changed": false,
"msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh",
"unreachable": true
}
proxy | SUCCESS | rc=0 >>
hello
monitor | SUCCESS | rc=0 >>
hello
最佳答案
在尝试了不同的指南之后,这个解决方案可以让我在没有目录 ssh 但通过代理/堡垒的服务器上使用 ansible。
这是我的 ~/.ssh/config 文件:
Host *
ServerAliveInterval 60
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
ForwardAgent yes
####### Access to the Private Subnet Server through Proxy/bastion ########
Host proxy-server
HostName x.x.x.x
ForwardAgent yes
Host private-server
HostName y.y.y.y
ProxyCommand ssh -q proxy-server nc -q0 %h %p
关于ssh - Ansible 通过堡垒服务器 SSH 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37892392/
我正在尝试设置 pentaho Spoon 以连接到 AWS 中的 VPN 上的 AWS auora。我可以通过堡垒服务器访问AWS auora(mysql)。它与 mysql 工作台和一个简单的 j
通过 Azure Bastion 连接时,我无法让 Windows Server 2019 数据中心识别 Alt Gr 键。该键被误认为是 Alt 键。我的本地操作系统是Windows 10,我的浏览
通过 Azure Bastion 连接时,我无法让 Windows Server 2019 数据中心识别 Alt Gr 键。该键被误认为是 Alt 键。我的本地操作系统是Windows 10,我的浏览
我尝试设置 nginx 来验证传入的 https 请求并将它们传递到同一 Intranet (LAN) 中不同主机上的服务器。我从不同的来源得到了以下 conf 文件: proxy_redir
我是一名优秀的程序员,十分优秀!