# Playbook ssh issues, AWX add ansible- prefix into the real user name

**URL:** <https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999>\
**Category:** Get Help\
**Tags:** playbook, awx\
**Created:** [September 21, 2023, 10:59am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999 "2023-09-21T10:59:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 21, 2023, 10:59am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/1 "2023-09-21T10:59:42Z")

</div>

I have some playbooks running without any issues in AWX 9.0.1.0 and currently I am working on moving all the playbooks to newer version AWX 23.0.0.When I run the playbook in AWX 23.0.0 GUI, it always fails, giving some SSH related errors, the related SSH command used by playbook looks something like

bash-5.1$ ssh -vvv -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=30m -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“test”’ -o ConnectTimeout=10 -o ‘ProxyCommand=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -W %h:%p -q [test@jump.test.net](mailto:test@jump.test.net)’ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ‘ControlPath=“~/.ssh/ansible-%r@%h:%p”’ [test.net](http://test.net)

When I copied this SSH command above into AWX task container and directly execute this SSH command , it is running success, so clearly the SSH public/private key set up is correct, also I am sure the credential to be configured in AWX has correctly imported the related SSH private key.

So I am confused now what else can be the cause

The key error logs are

```auto
  ` Authenticated to test.net (via proxy) using \"publickey\".\r\n

    debug1: pkcs11_del_provider: called, provider_id = (null)\r\n

    debug1: setting up multiplex master socket\r\n

    debug3: muxserver_listen: temporary control path /runner/.ssh/ansible-test@test.net:22.pqGv0YsDRO3Skadp\r\n

    unix_listener: cannot bind to path /runner/.ssh/ **ansible-test** @test.net:22.pqGv0YsDRO3Skadp: No such file or directory",
    "unreachable": true

```

` It is weird that the user listed above is ‘ansible-test’, but I have never configured this user anywhere in my platform, the real user should be ‘test’

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 21, 2023, 12:36pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/2 "2023-09-21T12:36:18Z")

</div>

The `ansible-test` string is coming from this:

> [@mapleos1123](#):
>
> -o ‘ControlPath=“~/.ssh/ansible-%r@%h:%p”’

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 21, 2023, 1:16pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/3 "2023-09-21T13:16:03Z")

</div>

> [@mapleos1123](#):
>
> When I copied this SSH command above into AWX task container and directly execute this SSH command , it is running success,

When you do that.`~/.ssh/ansible-%r@%h:%p` will be expanded in the context of your id’s `$HOME`. Is your `$HOME` `/runner`?

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 21, 2023, 2:41pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/4 "2023-09-21T14:41:54Z")

</div>

hi Thanks a lot, really appreciate your time

But it is a bit weird

I have the same .ssh configuration file for AWX 9.0.1.0 and AWX 23.0.0. Everything on AWX 9.0.1.0 is running smoothly, the issue is only in AWX 23.0.0

But anyway I tried to remove ‘ansible-’ prefix in my ssh.cfg file although i am not 100% sure how this control master works, now my ssh.cfg looks like

ControlMaster auto  
ControlPath ~/.ssh/%r@%h:%p  
ControlPersist 5m

But it seems still not working, I have committed the change into GIT and sync the project from AWX GUI and I can confirm the ssh.cfg file in AWX task container has also sync the updated file

My ID in the remote host is actually /home/noc, and user name is also ‘noc’, I have no clue where path ‘/runner’ is coming from

Can anyone or you please suggest some readings about what ‘control path’ parameter is about ?

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 21, 2023, 2:49pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/5 "2023-09-21T14:49:24Z")

</div>

`$ man 5 ssh_config`

But AWX isn’t running as you. It’s running as… well, I don’t know what it’s running as, but whoever/whatever it’s running as, the `~/` is shorthand for `/runner`, so it probably doesn’t matter what _your_ `ssh.cfg` has in it.

Caveat: I use AWX, but somebody else set it up and runs it. So maybe listen to someone who knows rather than my guessing. Good luck.

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [September 21, 2023, 8:48pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/6 "2023-09-21T20:48:52Z")

</div>

> [@utoddl](#):
>
> So maybe listen to someone who knows rather than my guessing. Good luck.

If we need the AWX team, we can ask them! Hey [@AWX](https://forum.ansible.com/groups/awx), do you know what’s going on here? 🙂

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 22, 2023, 6:46am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/7 "2023-09-22T06:46:22Z")

</div>

thanks for the tip 🙂

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 22, 2023, 6:48am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/8 "2023-09-22T06:48:12Z")

</div>

Thanks a lot

I temporarily made it work by disabling all control master parameter in the ansible.cfg and ssh.cfg file

Actually my project does not that need concurrency, maximum 2 or 3 users will execute the playbook at the same time

But I will figure it out how this control master feature works in Ansible later after fixing more pressing issues

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 22, 2023, 11:46am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/9 "2023-09-22T11:46:23Z")

</div>

I have more clue now what’s going on. First of all, you made an assumption about AWX’s use of `ControlPath` being in order to share a connection to a particular host _among multiple jobs_. It isn’t. It’s to avoid the overhead of standing up and tearing down ssh connections for every task _within the same job_. In fact, now that I read your initial post with eyes open, we can see that  
`~/.ssh/ansible-%r@%h:%p` became `/runner/.ssh/ansible-test@test.net:22.pqGv0YsDRO3Skadp`  
But the ssh TOKEN `%p` is the port, which accounts for the `22`. The rest of the string – `.pqGv0YsDRO3Skadp` – is unique to that particular job. AWX adds that to ensure that different jobs in fact _don’t_ share connections.

Now that you’ve removed the `ControlMaster` setting, when you run jobs with level 4 verbosity, do you still see `ControlMaster=auto` and `ControlPath` still being set? On our AWX, my job’s ssh connection shows  
`-o 'ControlPath="/runner/cp/40c3e6afae"'`  
Our appended uniquifier is shaped a little differently from yours, probably because we’re on a different version of AWX.

Practically, though, it looks like your jobs are running now and connecting to the intended remote hosts. Is that correct?

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 22, 2023, 12:07pm UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/10 "2023-09-22T12:07:43Z")

</div>

> [@utoddl](#):
>
> But the ssh TOKEN `%p` is the port, which accounts for the `22`. The rest of the string – `.pqGv0YsDRO3Skadp` – is aunique to that particular job. AWX adds that to ensure that different jobs in fact _don’t_ share connections.

hi @utoddl thanks a lot for your explanation, yes, my Playbook is being able to connect to the remote host successfully and my logs, I don’t see any ’ `ControlMaster=auto` and `ControlPath`’

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [October 6, 2023, 8:56am UTC](https://forum.ansible.com/t/playbook-ssh-issues-awx-add-ansible-prefix-into-the-real-user-name/999/11 "2023-10-06T08:56:44Z")

</div>

Hi @mapleos1123! It looks like the post might be solved - could you check to see if the response by @utoddl worked for you?

If so, it would be _super_ helpful if you could click the ✔ on their post to accept the solution - it recognises the input of others, helps our volunteers find new issues to answer, and keeps the forum nice and tidy.

Thanks!  
(this is template reply, do feel free to reply if I’ve misunderstood the situation!)
