# SSH Connection fails. Permission denied. Publickey, keyboard-interactive

**URL:** <https://forum.ansible.com/t/ssh-connection-fails-permission-denied-publickey-keyboard-interactive/26208>\
**Category:** Ansible Project\
**Tags:** windows, vmware, ubuntu\
**Created:** [December 5, 2017, 4:54pm UTC](https://forum.ansible.com/t/ssh-connection-fails-permission-denied-publickey-keyboard-interactive/26208 "2017-12-05T16:54:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gene\_Stanilevskiy](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@Gene\_Stanilevskiy](https://forum.ansible.com/u/Gene_Stanilevskiy)\
**Post date:** [December 5, 2017, 4:54pm UTC](https://forum.ansible.com/t/ssh-connection-fails-permission-denied-publickey-keyboard-interactive/26208/1 "2017-12-05T16:54:05Z")

</div>

Hi All,

New to Ansible. New to the group.

Trying to run some basic commands against my VMware environment and thought I would start with vmware\_facts.

```auto
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible 

```

python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

Ubuntu 16.0.4

My hosts file looks like this:

`  
[all]

[windows]  
TestServ  
TestServ1

[vsphere]  
host1 ansible\_connection=ssh ansible\_user=root ansible\_host=10.0.0.1  
host2 ansible\_user=root ansible\_connection=ssh ansible\_host=10.0.0.2

[localhost]  
127.0.0.1 ansible\_connection=local

`

I can successfully run the following command

`  
ansible vsphere -i hosts -m ping --ask-pass -vvv

> SUCCESS =\> {  
> “changed”: false,  
> “failed”: false,  
> “invocation”: {  
> “module\_args”: {  
> “data”: “pong”  
> }  
> },  
> “ping”: “pong”

`

After some research, here is the playbook that I came up with.

`

---

<div class="post-metadata">

**Author:** ![Gene\_Stanilevskiy](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@Gene\_Stanilevskiy](https://forum.ansible.com/u/Gene_Stanilevskiy)\
**Post date:** [December 5, 2017, 9:02pm UTC](https://forum.ansible.com/t/ssh-connection-fails-permission-denied-publickey-keyboard-interactive/26208/2 "2017-12-05T21:02:00Z")

</div>

I think I solved my problem. I re-wrote the playbook to look like this and it now gets vmware\_facts as expected.

`
