Net::SSH::AuthenticationFailed

Problem: REX fails:

Error initializing command: Net::SSH::AuthenticationFailed - Authentication failed for user ansible@x.x.x.x
2:
Exit status: EXCEPTION

Expected outcome:
REX runs without error

Foreman and Proxy versions:
Version 2.5.4

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:
I run REX jobs to clients. I have the REX ssh over an ansible user and then it sudos to run the commands that I need.
It is very random but some servers receive the AuthenticationFailed error, even though the ssh keys are on the clients. If I run the jobs again to the failed servers, it magically does not fail. It is random servers that this happens on, and I cannot see any sort of pattern.

So, REX fails with authentication failure but will run without errors if you rerun the REX job.

Thanks all,.

Most likely the job goes out to the hosts through multiple smart proxies and some hosts don’t allow access from some proxies. If you rerun the job on failed hosts, then the job goes to the hosts through a different proxy and then it works.

Thank you for that. Do you know where I can verify REX/SSH on the proxies I have? I can’t seem to find them.

In the left-hand menu under Infrastructure > Smart Proxies

Ok I see that but to add features, such as SSH, I can’t see where I would enable that at. I do see some of my proxies have SSH enabled while others do not.