# FAILED =\> SSH Error: Permission denied (publickey,password).

**URL:** <https://forum.ansible.com/t/failed-ssh-error-permission-denied-publickey-password/19640>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 28, 2015, 5:21pm UTC](https://forum.ansible.com/t/failed-ssh-error-permission-denied-publickey-password/19640 "2015-10-28T17:21:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rashidjilani](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rashidjilani](https://forum.ansible.com/u/rashidjilani)\
**Post date:** [October 28, 2015, 5:21pm UTC](https://forum.ansible.com/t/failed-ssh-error-permission-denied-publickey-password/19640/1 "2015-10-28T17:21:07Z")

</div>

Hi: I am using ansible 1.9.4 on ubuntu trusty 64 linux, but when I run the ansible " sudo ansible -vvv testserver -i hosts -m ping"

to connect to the remote host using ssh key I am getting the following errors

" \<192.168.33.10\> ESTABLISH CONNECTION FOR USER: vagrant  
\<192.168.33.10\> REMOTE\_MODULE ping  
\<192.168.33.10\> EXEC ssh -C -tt -v -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o IdentityFile=“./private\_key” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 192.168.33.10 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446052583.77-94878036124642 && echo $HOME/.ansible/tmp/ansible-tmp-1446052583.77-94878036124642’  
testserver | FAILED =\> SSH Error: Permission denied (publickey,password).  
while connecting to 192.168.33.10:22  
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue. "

here is content of my hosts file “testserver ansible\_ssh\_host=192.168.33.10 ansible\_ssh\_port=22 ansible\_ssh\_user=vagrant ansible\_ssh\_private\_key\_file=./private\_key”

I googled for hours but nothing works, can please some one help.

Regards,  
RJ.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 2, 2015, 2:47pm UTC](https://forum.ansible.com/t/failed-ssh-error-permission-denied-publickey-password/19640/2 "2015-11-02T14:47:54Z")

</div>

can you login just using the command?:

ssh -C -tt -vvvv -o ControlMaster=auto -o ControlPersist=60s -o  
ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o  
Port=22 -o IdentityFile="./private\_key" -o  
KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey  
-o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10  
192.168.33.10

the issue seems to be authentication related

---

<div class="post-metadata">

**Author:** ![GBANE\_FETIGUE](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@GBANE\_FETIGUE](https://forum.ansible.com/u/GBANE_FETIGUE)\
**Post date:** [November 2, 2015, 4:15pm UTC](https://forum.ansible.com/t/failed-ssh-error-permission-denied-publickey-password/19640/3 "2015-11-02T16:15:15Z")

</div>

SSH has those issues sometimes what you want to do is to establish a local connection : 1[92.168.33.10 ansible\_connection=local](http://www.google.com/url?q=http%3A%2F%2F192.168.33.10%3A22&sa=D&sntz=1&usg=AFQjCNFr2dv0wK30xbxbI6CCzcEecFF2wQ)
