# ansible cannot log into server, yet I can ssh in manually

**URL:** <https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083>\
**Category:** Ansible Project\
**Created:** [June 12, 2023, 10:17am UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083 "2023-06-12T10:17:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kathy\_L](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kathy_l/32/2652_2.png) [@Kathy\_L](https://forum.ansible.com/u/Kathy_L)\
**Post date:** [June 12, 2023, 10:17am UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/1 "2023-06-12T10:17:18Z")

</div>

As the title says, I am trying to run an ansible playbook against 10 hosts. All 10 fail stating they cannot connect to the host via ssh. The error sent back from ansible is:

“Failed to connect to the host va ssh… Received disconnect… Too many authentication failures.”

Yet if I ssh into the host manually with the same account I can get into the host fine.

I’ve run the setup module against these hosts with the same issue. When I run ansible with -vvv the only thing I see is ssh trying 3 times and failing…

Any ideas on what else I can try?

---

<div class="post-metadata">

**Author:** ![Prady\_A](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prady_a/32/4792_2.png) [@Prady\_A](https://forum.ansible.com/u/Prady_A)\
**Post date:** [June 12, 2023, 10:20am UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/2 "2023-06-12T10:20:26Z")

</div>

Give some details about below:  
from which user you are trying to connect to.  
From which user your ssh is configured.  
And from which user you are ruining your ansible script…

---

<div class="post-metadata">

**Author:** ![Thanh\_Nguyen\_Duc](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Thanh\_Nguyen\_Duc](https://forum.ansible.com/u/Thanh_Nguyen_Duc)\
**Post date:** [June 12, 2023, 10:22am UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/3 "2023-06-12T10:22:52Z")

</div>

Are you using key authentication or password authentication? what is the secure log in your target machine? how did you configure it?

Vào Th 2, 12 thg 6, 2023 vào lúc 18:17 Kathy L \<[lyonsfive@gmail.com](mailto:lyonsfive@gmail.com)\> đã viết:

---

<div class="post-metadata">

**Author:** ![Kathy\_L](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kathy_l/32/2652_2.png) [@Kathy\_L](https://forum.ansible.com/u/Kathy_L)\
**Post date:** [June 12, 2023, 11:12am UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/4 "2023-06-12T11:12:19Z")

</div>

I am not using key authentication - userid and password. I’ve checked multiple times to ensure it is the correct userid and password. I’ve tried using --ask-pass as well as entering the user name and password in the hosts file.

I’m using ansible version. 2.14.4 against CentOS 7 and Debian hosts.

My secure log says it is looking for a public key, which I do not have set up. The sshd\_config file clearly states “PasswordAuthentication yes”.

I use the same user in my ansible hosts file as when I ssh in.

---

<div class="post-metadata">

**Author:** ![Thanh\_Nguyen\_Duc](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Thanh\_Nguyen\_Duc](https://forum.ansible.com/u/Thanh_Nguyen_Duc)\
**Post date:** [June 12, 2023, 1:12pm UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/5 "2023-06-12T13:12:36Z")

</div>

Seem like it still using default configuration of ansible. Can show -vvvv and your config?

---

<div class="post-metadata">

**Author:** ![Prady\_A](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prady_a/32/4792_2.png) [@Prady\_A](https://forum.ansible.com/u/Prady_A)\
**Post date:** [June 12, 2023, 1:31pm UTC](https://forum.ansible.com/t/ansible-cannot-log-into-server-yet-i-can-ssh-in-manually/38083/6 "2023-06-12T13:31:33Z")

</div>

I suspect your ssh public key is not copied properly to those managed nodes. need to check config file. Check in the managed node whether the ssh public key is copied or not if you are using password less authentication.
