# Connecting to Linux Host from Windows Host

**URL:** <https://forum.ansible.com/t/connecting-to-linux-host-from-windows-host/2947>\
**Category:** Get Help\
**Tags:** windows, collections\
**Created:** [December 17, 2023, 2:00pm UTC](https://forum.ansible.com/t/connecting-to-linux-host-from-windows-host/2947 "2023-12-17T14:00:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrijatina](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adrijatina](https://forum.ansible.com/u/adrijatina)\
**Post date:** [December 17, 2023, 2:00pm UTC](https://forum.ansible.com/t/connecting-to-linux-host-from-windows-host/2947/1 "2023-12-17T14:00:25Z")

</div>

Hello Team I am totally new to Ansible and I have got one task like this  
Connect to a Windows server-----\> from the windows server connect to a linux server via the ssh key I have manually tested this is possible but this entire connection setup is now to be done via ansible can anyone please help me how to do this ? I have researched quite a lot and found that in my local pywinrm module needs to be installed and use the ansible\_winrm module to establish connection to the windows server but from windows to linux server I am not getting any clue please note the windows server is the intermediatary server and ansible cannot be installed on the server

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 18, 2023, 3:03am UTC](https://forum.ansible.com/t/connecting-to-linux-host-from-windows-host/2947/2 "2023-12-18T03:03:05Z")

</div>

Hello @adrijatina,

Let’s see if I got it straight; what you want to do is to use your windows server as a jump host in order to deploy or configure a Linux server that is out of reach from your local machine?

If that’s so, you need to be aware that Ansible does not run natively on windows. I mean, you need to use WSL2 (preferably) along with a Linux VM (e.g. Ubuntu, Fedora, etc) on your win server to execute Ansible. Then, from within WSL you could enable an ssh-server so the Linux VM can perform the connection to the target Linux server (that is- the WSL Linux VM acts as the jump host here). However, as far as I know this approach is not quite stable , but there are workarounds for that- you may set the ssh server on windows and then use WSL as the default shell, as suggested on this blog post:

> **[How to set up an SSH Server on Windows with WSL](https://tiim.ch/blog/2022-03-ssh-windows-wsl)**
>
> It can be very helpful to be able to connect to your laptop or desktop PC from anywhere using SSH. I will show you how to easily set this up on Windows with WSL.

Then, on your local machine you also need to set an specific ssh configuration on `~/.ssh/config`, so the connection gets tunneled through the jump host.

I suggest you to catch a glimpse to this piece of documentation, which may be of use to you, too:

[https://docs.ansible.com/ansible/latest/inventory\_guide/connection\_details.html](https://docs.ansible.com/ansible/latest/inventory_guide/connection_details.html)

If anyone else knows a better way to stablish a windows based jump host, it may be good to know 🙂

Hope it helps!
