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

73 views
Skip to first unread message

gonzalo diaz larenas

unread,
Jun 22, 2023, 2:38:52 PM6/22/23
to Ansible Project
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
Inventory 22-06-2023.JPG

Brian Coca

unread,
Jun 22, 2023, 6:34:26 PM6/22/23
to ansible...@googlegroups.com

gonzalo diaz larenas

unread,
Jun 26, 2023, 9:06:35 AM6/26/23
to ansible...@googlegroups.com
Dear, thank you for answering, I already did all those steps, and it keeps throwing me the same error.
Using the ssh command admini...@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.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7dqnVE%3DYod5aujn8eTN4AEV25-T-EEqG6J%2Bkc-sVHP-qg%40mail.gmail.com.
Problemas de conectividad ssh Windows 23-06-2023.JPG

Prady A

unread,
Jun 26, 2023, 9:45:37 AM6/26/23
to ansible...@googlegroups.com
Hi

Login to your control machine with the user you control.
1 . Generate the ssh key using ssh keygen. 
 # ssh keygen
2. Copy the pub key to the same user where you created the key.
Ex : #ssh-copy-id admistrator@<ip of managed node>
3. Try the adhoc command 
 Ex: #ansible -i inventory -m ping

Read the ansible doc carefully again.



jbor...@gmail.com

unread,
Jun 26, 2023, 5:01:05 PM6/26/23
to Ansible Project
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.

gonzalo diaz larenas

unread,
Jun 28, 2023, 11:40:51 AM6/28/23
to ansible...@googlegroups.com
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.



Problemas de conectividad ssh Windows 27-06-2023___.JPG
Problemas de conectividad ssh Windows 27-06-2023.JPG

Nico Kadel-Garcia

unread,
Jun 28, 2023, 6:39:31 PM6/28/23
to ansible...@googlegroups.com
On Wed, Jun 28, 2023 at 11:40 AM gonzalo diaz larenas
<gonzalodi...@gmail.com> wrote:
>
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF-YWcbpRCxuqScqs4dHuheL%2BfX-y_Wf%3DT8CHpk0VW%3DSN6ZFNg%40mail.gmail.com.

jbor...@gmail.com

unread,
Jun 28, 2023, 7:13:07 PM6/28/23
to Ansible Project
Literally set `ansible_shell_type=powershell` for your Windows hosts. It's what's in the docs you were linked to.
Reply all
Reply to author
Forward
0 new messages