Remote Execution Fails

Hey Guys,

I changed the the key and this time I am getting a new error could you please help me in solving this now.

Below is the error

#####################################

Host,stdout,stderr,debug,Result,Finished
xdevsl.admiral.es,"","",“Initialization error: RestClient::NotFound - 404 Not Found
Initialization error: RestClient::NotFound - 404 Not Found
Initialization error: RestClient::NotFound - 404 Not Found
Initialization error: RestClient::NotFound - 404 Not Found
Error loading data from proxy: NoMethodError - undefined method `code’ for ““404 Not Found””:String
Did you mean? encode”,error,2022-8-2 13:08:15 +0000

###############################################################

Again: if you do a new foreman installation on a new server a new key will be generated in /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy and var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy.pub. As it’s a new server and a new key which isn’t used anywhere else, yet, you can always replace that key with the one you already have.

The ssh/script proxy plugin reads its configuration from /etc/foreman-proxy/settings.d/remote_execution_ssh.yml. That should contain the name of the key file it uses.

Of course, that file is (over)written by foreman-installer. To change that permanently you should use foreman-installer options:

# foreman-installer --help
...
= Module foreman_proxy_plugin_remote_execution_ssh:
    --foreman-proxy-plugin-remote-execution-ssh-generate-keys  Automatically generate SSH keys (current: true)
    --foreman-proxy-plugin-remote-execution-ssh-install-key  Automatically install generated SSH key to root authorized keys
                                  which allows managing this host through Remote Execution (current: false)
    --foreman-proxy-plugin-remote-execution-ssh-local-working-dir  Local working directory on the smart proxy (current: "/var/tmp")
    --foreman-proxy-plugin-remote-execution-ssh-mode  Operation Mode of the plugin. (current: "ssh")
    --foreman-proxy-plugin-remote-execution-ssh-remote-working-dir  Remote working directory on clients (current: "/var/tmp")
    --foreman-proxy-plugin-remote-execution-ssh-ssh-identity-dir  Directory where SSH keys are stored (current: "/var/lib/foreman-proxy/ssh")
    --foreman-proxy-plugin-remote-execution-ssh-ssh-identity-file  Provide an alternative name for the SSH keys (current: "id_rsa_foreman_proxy")
    --foreman-proxy-plugin-remote-execution-ssh-ssh-kerberos-auth  Enable kerberos authentication for SSH (current: false)
    --foreman-proxy-plugin-remote-execution-ssh-ssh-keygen  Location of the ssh-keygen binary (current: "/usr/bin/ssh-keygen")
...
1 Like