# Several non-standard ssh ports

**URL:** <https://forum.ansible.com/t/several-non-standard-ssh-ports/36340>\
**Category:** Ansible Developer\
**Created:** [February 17, 2022, 8:29am UTC](https://forum.ansible.com/t/several-non-standard-ssh-ports/36340 "2022-02-17T08:29:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![igor\_haase](https://avatars.discourse-cdn.com/v4/letter/i/e0b2c6/32.png) [@igor\_haase](https://forum.ansible.com/u/igor_haase)\
**Post date:** [February 17, 2022, 8:29am UTC](https://forum.ansible.com/t/several-non-standard-ssh-ports/36340/1 "2022-02-17T08:29:23Z")

</div>

Hello everyone,  
I am new in ansible. Therefore I have a question about editing the ansible.cfg.  
I am running a couple of server on different non-standard ssh ports e.g.  
55500 55008 55012 etc.

How can I configure that in the ansible.cfg? I already tried with seperated ,

Thanks in advance

Igor

---

<div class="post-metadata">

**Author:** ![Irwan\_Shofwan](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@Irwan\_Shofwan](https://forum.ansible.com/u/Irwan_Shofwan)\
**Post date:** [February 17, 2022, 10:26am UTC](https://forum.ansible.com/t/several-non-standard-ssh-ports/36340/2 "2022-02-17T10:26:17Z")

</div>

It’s better to specify host port for each host in your inventory or you can grouping host by port number

---

<div class="post-metadata">

**Author:** ![Andreas\_Harpfer](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Andreas\_Harpfer](https://forum.ansible.com/u/Andreas_Harpfer)\
**Post date:** [February 17, 2022, 10:31am UTC](https://forum.ansible.com/t/several-non-standard-ssh-ports/36340/3 "2022-02-17T10:31:57Z")

</div>

Hi Igor, non-standard SSH ports typically go into the inventory,  
not into ansible.cfg.

You can do either

&nbsp;&nbsp;&nbsp;&nbsp;[somegroup]  
&nbsp;&nbsp;&nbsp;&nbsp;somehost:2222

or

&nbsp;&nbsp;&nbsp;&nbsp;[somegroup]  
&nbsp;&nbsp;&nbsp;&nbsp;somehost ansible\_port=2222

See

&nbsp;&nbsp;&nbsp;&nbsp;[https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html#assigning-a-variable-to-one-machine-host-variables](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#assigning-a-variable-to-one-machine-host-variables)

for more details.

Cheers  
-Andi

---

<div class="post-metadata">

**Author:** ![Tjkent88](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tjkent88/32/4521_2.png) [@Tjkent88](https://forum.ansible.com/u/Tjkent88)\
**Post date:** [February 22, 2022, 3:30pm UTC](https://forum.ansible.com/t/several-non-standard-ssh-ports/36340/4 "2022-02-22T15:30:31Z")

</div>

I would recommend looking into the inventory file.
