# AWX - conection via ssh key problem

**URL:** <https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591>\
**Category:** AWX Project\
**Tags:** ubuntu, awx\
**Created:** [January 30, 2023, 1:05pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591 "2023-01-30T13:05:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [January 30, 2023, 1:05pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/1 "2023-01-30T13:05:32Z")

</div>

Welcome,

I have the following problem:

When I try to execute the ping command on an external server (authentication via ssh), a connection timeout message is displayed. When creating credentials, the type was selected “Machine” and the corresponding ssh key was added. In addition, the ping to the external VM also did not work via ssh, while it went through the password successfully. I want the connection via ssh to go through successfully.

Deployment details:

- OS version: Ubuntu 20 04

- Client Version: v1.25.5+k3s2

- Kustomize Version: v4.5.7

- Server Version: v1.25.5+k3s2

- The server is a VM created on KVM

- AWX version - 21.5.0

In addition:

- In the deployment version on docker (awx version 17.1.0) the problem described above does not occur.- After installing ansible locally on the server where the problem occurs, it is possible to execute the ad-hoc command

- After installing ansible locally on the server where the problem occurs, it is possible to execute the ad-hoc command

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [January 30, 2023, 1:29pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/2 "2023-01-30T13:29:38Z")

</div>

Is your playbook / task attempting to elevate privilege with become: true?  
Does your remote\_user (ssh user) have permission to do that?

Walter

---

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [January 30, 2023, 1:53pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/3 "2023-01-30T13:53:45Z")

</div>

Actually, I cannot execute remotely even simply modules like ping,cmd,shell via inventory from awx.  
My user has permission to do these things.

---

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [February 1, 2023, 12:40pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/4 "2023-02-01T12:40:25Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [February 6, 2023, 3:21pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/5 "2023-02-06T15:21:11Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [February 8, 2023, 8:07pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/6 "2023-02-08T20:07:53Z")

</div>

Hello,  
We would like to gather some more information from you. Could you run the ping module against the host again with verbosity set to 3 and provide us with that output? Thank you for that additional information!

-AWX Team

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [February 10, 2023, 9:02am UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/7 "2023-02-10T09:02:36Z")

</div>

Hi,  
I’m working with brx and here’s the output from the ping module.  
BR

> **(attachments)**
>
> [output\_awx.txt](https://forum.ansible.com/uploads/short-url/mFMECTgYRPhYtXenJPNxeh3sE6b.txt) (1.77 KB)

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [February 10, 2023, 6:40pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/8 "2023-02-10T18:40:49Z")

</div>

Are you able to ssh directly from the awx control node command line? If so, how long does that connection typically take? If not, you should investigate any proxy or firewall that could be in the middle.

Thanks,

AWX Team

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [February 13, 2023, 7:29am UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/9 "2023-02-13T07:29:55Z")

</div>

Yes, I’m able to connect via ssh from control node to destination host. It takes typically under 1 sec.

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [February 14, 2023, 10:45am UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/10 "2023-02-14T10:45:53Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [February 15, 2023, 7:59pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/11 "2023-02-15T19:59:56Z")

</div>

do you mind providing the output of /api/v2/ad\_hoc\_jobs/ (or /api/v2/jobs if you ran a playbook) for that ping? we can take a closer look (be sure to remove sensitive info before uploading)

AWX Team

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [February 15, 2023, 8:01pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/12 "2023-02-15T20:01:47Z")

</div>

sorry it is at api/v2/ad\_hoc\_commands

---

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [February 20, 2023, 2:23pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/13 "2023-02-20T14:23:59Z")

</div>

Output has been added in the attachment.

> **(attachments)**
>
> [api\_output.txt](https://forum.ansible.com/uploads/short-url/eU66DRf397WezmD2emmscHun95o.txt) (3.83 KB)

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [February 22, 2023, 8:02pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/14 "2023-02-22T20:02:46Z")

</div>

can you successfully establish a connection to your host from inside the awx-ee container? You can use podman run to run awx-ee container (outside of awx), exec into it and try to ssh into your host? that is closer to how k8s will be doing it.

do other regular jobs (based on job templates) run okay (i.e. is it just ad hoc commands that cause issues?)

AWX Team

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [March 7, 2023, 3:27pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/15 "2023-03-07T15:27:26Z")

</div>

Hi,  
First for all we want to apologize for long break. Some others tasks came to us that were need to solve. We think this is the output that you’ve asked for. We’re not using podeman. This output was intercepted by entering thru crictl to a running awx-ee container. Added in attachment.  
BR

> **(attachments)**
>
> [container\_ssh.txt](https://forum.ansible.com/uploads/short-url/21H9fGT99g9YJ4lU9837rnQA8AR.txt) (2.44 KB)

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [March 10, 2023, 11:13am UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/16 "2023-03-10T11:13:47Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [March 10, 2023, 6:19pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/17 "2023-03-10T18:19:23Z")

</div>

What does your deployment look like? the automation job pods are running in the same cluster as your control node correct? are you using a container group to connect out to a different cluster?

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [March 13, 2023, 1:28pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/18 "2023-03-13T13:28:20Z")

</div>

Hi,  
In screens below, I’ve attached (I think) whole info about our deployment. Tbh I’m not master of k8s/k3s but from the tutorial that we used for setting up this environment I can deduce automation job pods are running in the same cluster as control node.  
 ![awx-dep-1-conf.jpg](https://us1.discourse-cdn.com/ansible/original/2X/1/19d7968c8c38abfd868101dad97ef980830bb9cb.jpeg)

 ![awx-dep-2-ident.jpg](https://us1.discourse-cdn.com/ansible/original/2X/9/9814079bc6807da6dddf946044bd95fd9e29353e.jpeg)  
 ![awx-dep-3-ku.png](https://us1.discourse-cdn.com/ansible/original/2X/1/15694bc6820375d6be5865ccd646205899710db0.png) ![awx-dep-4-tas.png](https://us1.discourse-cdn.com/ansible/original/2X/a/ac1f897e8980cabc6a1b3080040ea10b1f44d479.png)  
Additionally, here is a worker container (marked as red) that launches during job execution.  
 ![awx-dep-5-worker.png](https://us1.discourse-cdn.com/ansible/original/2X/4/4c690c7d513488eba0b7e899846ff2d40e386480.png)  
BR,  
Piotr

---

<div class="post-metadata">

**Author:** ![dawid.grygrzc](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dawid.grygrzc](https://forum.ansible.com/u/dawid.grygrzc)\
**Post date:** [March 17, 2023, 3:30pm UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/19 "2023-03-17T15:30:07Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![Pi3tr4sh3k](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pi3tr4sh3k/32/1529_2.png) [@Pi3tr4sh3k](https://forum.ansible.com/u/Pi3tr4sh3k)\
**Post date:** [March 20, 2023, 7:54am UTC](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591/20 "2023-03-20T07:54:00Z")

</div>

bump

[Next page](https://forum.ansible.com/t/awx-conection-via-ssh-key-problem/37591.md?page=2)
