Remote Execution fails with error 'Error initializing command - RuntimeError Could not establish connection to remote host using any available authentication method, tried publickey'
Environment
- Red Hat Capsule 6
- Red Hat Satellite 6
Issue
-
Remote execution fails with the below error on the hosts that are registered to the capsule server.
Error initializing command - RuntimeError Could not establish connection to remote host using any available authentication method, tried publickey:
Resolution
-
Run the below command to enable remote execution on the capsule cli if client is registered to the capsule server
# satellite-installer --enable-foreman-proxy-plugin-remote-execution-script -
Distribute the foreman-proxy ssh public key of the capsule server to the client machine and run the below command from the capsule cli.
# ssh-copy-id -i ~foreman-proxy/.ssh/id_rsa_foreman_proxy.pub user@host.example.com -
Check if the satellite can DNS resolve the name of the content host. If not, need to add the below entries in the file `/etc/hosts' file or add the client and IP address in the DNS server for DNS resolution.
# vi /etc/hosts <IP Address> <client FQDN>
For more KB articles/solutions related to Red Hat Satellite 6.x Remote Execution Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Remote Execution Issues
Root Cause
- The remote execution feature is not enabled on the capsule server and the foreman-proxy ssh public key is not distributed to the client machine.
Diagnostic Steps
-
Need to check if the satellite server can perform a DNS resolution for the client hostname.
nslookup client.example.com
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.