mac 系统
远控一台centos虚拟机,设置虚拟机免密登录其他两台centos虚拟机
用mac的terminal工具远控执行 ansible 的相关命令 出现了报错,
但是我直接通过虚拟机却可以执行,并且在直接用虚拟机执行 ansible 相关命令之后,在一小段时间内,可以用 mac 的 terminal 远控执行 ansible 相关命令了,但是过一会就又不能执行了
[root@localhost ~]# ansible all -m ping
192.168.112.132 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@192.168.112.132: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
"unreachable": true
}
192.168.112.133 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@192.168.112.133: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
"unreachable": true
}
[root@localhost ~]# ansible all -m command -a "ls /root"
192.168.112.132 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@192.168.112.132: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
"unreachable": true
}
192.168.112.133 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@192.168.112.133: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
"unreachable": true
}