【发布时间】:2018-01-23 13:28:50
【问题描述】:
我正在尝试使用 OpenSSH 和 Ansible 连接到我的 Windows 计算机。
我可以使用常规 ssh 进行连接,但是当我尝试使用 Ansible 进行连接时,每次更改某些内容时都会遇到几乎相同的错误。
我也尝试过以 root 身份运行 Ansible,但仍然没有
fatal: [IVU]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /tmp/ansible-tmp-1502794936.2073953-164132649383245 `\" && echo ansible-tmp-1502794936.2073953-164132649383245=\"` echo /tmp/ansible-tmp-1502794936.2073953-164132649383245 `\" ), exited with result 1", "unreachable": true}
我尝试将 ansible.cfg 中的 ssh_args 更改为 ssh_args= -o ControlMaster=no 并且没有对输出进行任何更改。
我尝试将 ansible.cfg 中的可执行文件更改为 C:/Windows/System32/cmd.exe,但我得到了同样的错误
我已尝试更改 remote_dir=/tmp/,但仍然没有。
我的 ansible 库存是:
[IVU]
IVU ansible_host=**IP**
[IVU:vars]
ansible_port=22
ansible_user=**user**
ansible_ssh_pass=**pass**
ansible_ssh_private_key_file=** Keyfile **
它似乎在运行任何任务之前就失败了,但是从 windows 计算机上的 openssh 日志中,我发现 ansible 连接到它和我 ssh 进入它时没有区别。
3724 09:27:38:720 error: Couldn't create pid file "C:\\Program Files\\OpenSSH\\sshd.pid": Permission denied
3724 09:27:41:376 Accepted publickey for **User** from **IP** port 42700 ssh2: RSA SHA256:clNmiKxygl/TLEb5Ob4lZs6JqztoQyxOsjMoHQ2HYgo
3724 09:27:58:533 Received disconnect from **IP** port 42700:11: disconnected by user
3724 09:27:58:533 Disconnected from user **User** **IP** port 42700
3360 09:28:41:398 error: Couldn't create pid file "C:\\Program Files\\OpenSSH\\sshd.pid": Permission denied
3360 09:28:41:616 Accepted publickey for **User** from **IP** port 42704 ssh2: RSA SHA256:clNmiKxygl/TLEb5Ob4lZs6JqztoQyxOsjMoHQ2HYgo
3360 09:28:41:741 Received disconnect from **IP** port 42704:11: disconnected by user
3360 09:28:41:741 Disconnected from user **User** **IP** port 42704
9:27 是我使用 ssh 连接的时间,而 9:28 是 ansible 连接的时间。
为了让 Ansible 在 Windows 上与 openSSH 一起工作,我是否缺少一些需要更改的东西?
【问题讨论】:
标签: windows ssh ansible openssh