# Ssh connectivity issues from a Debian core server to a remote Windows 10 Pro host.

**URL:** <https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 22, 2023, 6:37pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145 "2023-06-22T18:37:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalo\_diaz\_larenas](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@gonzalo\_diaz\_larenas](https://forum.ansible.com/u/gonzalo_diaz_larenas)\
**Post date:** [June 22, 2023, 6:37pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/1 "2023-06-22T18:37:04Z")

</div>

Hello how are you, I am trying to connect remotely via ssh to a remote Windows 10 Pro host, I apply the ad-hoc command and the only remote host that does not respond is the one with Windows 10 Pro installed, I attach the connectivity error, and I attach my inventory.yml file, I would appreciate your guidance.

 ![Problemas de conectividad ssh Windows 22-06-2023.JPG](https://us1.discourse-cdn.com/ansible/original/2X/9/9bcd47e1690dc8fd8b4a77845765619930d9f4bf.jpeg)

 ![Inventory 22-06-2023.JPG](https://us1.discourse-cdn.com/ansible/original/2X/8/868ac96cd6f7a8305818829182a617a2186707e8.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 22, 2023, 10:32pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/2 "2023-06-22T22:32:02Z")

</div>

Did you follow [https://docs.ansible.com/ansible/latest/os\_guide/windows\_setup.html#windows-ssh-setup](https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html#windows-ssh-setup) ?

---

<div class="post-metadata">

**Author:** ![gonzalo\_diaz\_larenas](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@gonzalo\_diaz\_larenas](https://forum.ansible.com/u/gonzalo_diaz_larenas)\
**Post date:** [June 23, 2023, 2:29pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/3 "2023-06-23T14:29:28Z")

</div>

Dear, thank you for answering, I already did all those steps, and it keeps throwing me the same error.  
Using the ssh command administrator@192.168.x.x I can connect directly without any problem, I have it configured so that it does not ask me for a password when making the ssh connection, the problem happens when I apply any ansible ad-hoc command For example ansible -i inventory -m ping all, or when I apply a playbook, I attach a file with the ssh connection directly to the Windows 10 machine from a centralized Debian server, I would appreciate your guidance.

> **(attachments)**
>
> ![Problemas de conectividad ssh Windows 23-06-2023.JPG](https://us1.discourse-cdn.com/ansible/original/2X/7/7ddeb4d3e6de5685a6f2c054fd8940885d009780.jpeg)

---

<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 26, 2023, 1:45pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/4 "2023-06-26T13:45:14Z")

</div>

Hi

Login to your control machine with the user you control.  
1 . Generate the ssh key using ssh keygen.

# ssh keygen

1. Copy the pub key to the same user where you created the key.  
Ex : #ssh-copy-id admistrator@
2. Try the adhoc command  
Ex: #ansible -i inventory -m ping

Read the ansible doc carefully again.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 26, 2023, 9:01pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/5 "2023-06-26T21:01:05Z")

</div>

Based on your screenshot you didn’t define ansible\_shell\_type for the Windows hosts as per the guide. This is crucial for getting ssh to work with Windows as it must match the remote shell that’s being used, in your case that’s powershell.

---

<div class="post-metadata">

**Author:** ![gonzalo\_diaz\_larenas](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@gonzalo\_diaz\_larenas](https://forum.ansible.com/u/gonzalo_diaz_larenas)\
**Post date:** [June 28, 2023, 1:58pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/6 "2023-06-28T13:58:10Z")

</div>

I already did the generation of the public key, then I copied it to the host that has Windows Pro, I did all these steps to the letter, in the inventory.yml file I also made the corresponding changes, based on the help of ansible- doc, but now it throws me a totally different error, I don’t really know what it is, I am attaching the corresponding files, I would appreciate your help.

> **(attachments)**
>
> ![Problemas de conectividad ssh Windows 27-06-2023___.JPG](https://us1.discourse-cdn.com/ansible/original/2X/9/947242ee0b10092246eca5ddd7d30015da4cf989.jpeg)  
> ![Problemas de conectividad ssh Windows 27-06-2023.JPG](https://us1.discourse-cdn.com/ansible/original/2X/4/4e5b298ac9cc28e8f422b40e98f901ac6ff291a9.jpeg)

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [June 28, 2023, 10:39pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/7 "2023-06-28T22:39:08Z")

</div>

> I already did the generation of the public key, then I copied it to the host that has Windows Pro, I did all these steps to the letter, in the inventory.yml file I also made the corresponding changes, based on the help of ansible- doc, but now it throws me a totally different error, I don't really know what it is, I am attaching the corresponding files, I would appreciate your help.

"ping" is not your friend" for validating SSH access. Ping relies on  
ICMP packets, which are often blocked by firewalls. "ssh-keyscan" is  
your friend, especially since it will validate hostkey compatibility.  
Obsolete versions of OpenSSH, such as those hosted by Microsoft's  
DevOps git servers, do not provide hostkeys with contemporary  
protocols. So it's worth checking that your SSH client is compatible  
with your SSH server setup, especially if the SSH server is on  
something as old as Windows 10.

Also python 2.7 is \*way, way, way\* out of date for ansible, and should  
be updated to Python 3 ASAP.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 28, 2023, 11:13pm UTC](https://forum.ansible.com/t/ssh-connectivity-issues-from-a-debian-core-server-to-a-remote-windows-10-pro-host/38145/8 "2023-06-28T23:13:07Z")

</div>

Literally set `ansible_shell_type=powershell` for your Windows hosts. It’s what’s in the docs you were linked to.
