Foreman remote exec -ssh via proxy

O.K. But what is happening when you are using foreman-proxy, i.e.:

# sudo -u foreman-proxy ssh -i /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy root@test.example.com date

You don’t write it. I can only guess what you mean.

Well, look at the command I have been posting and just posted again and how often I wrote where foreman expects the key to be. It’s not /var/lib/foreman-proxy/ssh/sv_id_rsa. It is passed on the command line which takes precedence.

And if you had started that you are using ProxyCommand or even simply search the forum for that you would have found Remote execution not using jump host/bastion host configuration which @areyus already posted in the beginning of this thread.

The foreman proxy currently runs ssh with command line option -o ProxyCommand=none which again takes precedence… If it’s a current foreman version you are using…