Search code examples
rundeck

Authentication failure connecting to node - Could not authenticate error on Rundeck


I have a node in Rundeck 4.10 community version with ubuntu 22 where I am trying to make SSH from Rundeck. Its giving authentication error. The node is as follows

<node name="node-name" description="node-description" tags="reg"
        hostname="node-name" username="ubuntu"
        osFamily="unix" osName="Ubuntu"> 
</node>

My SSH key is in this path on the server: /home/ubuntu/rundeck/privatekey.pem

And on Rundeck storage, it is in this path: keys/project/project_name/privatekey

This target node is also running on Ubuntu 22. But I have other nodes which are running on Ubuntu 18 and I am able to execute jobs from Rundeck on these nodes with this existing SSH key configuration except on the node with Ubuntu 22. My other nodes are working without mentioning the ssh-key-storage-path name in resources file. I added ssh-key-storage-path attribute also in the resources.xml file an tried running the job from Rundeck.

I tried connecting to this ubuntu 22 target server from Rundeck shell and it is working fine but from Rundeck GUI, its giving authentication error. Below is the error in detail:

   Authentication failure connecting to node: "node-name". Could not authenticate.
Failed dispatching to node node-name: [jsch-scp] Failed copying the file: Authentication failure connecting to node: "node-name". Could not authenticate.
Execution failed: in project project-name: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [node-name: AuthenticationFailure: [jsch-scp] Failed copying the file: Authentication failure connecting to node: "node-name". Could not authenticate.]}, Node failures: {node-name=[AuthenticationFailure: [jsch-scp] Failed copying the file: Authentication failure connecting to node: "node-name". Could not authenticate.]}, status: failed]

Can someone help me in this?


Solution

  • In some modern linux distrubutions the default SSH Node Executor needs some changes to work with the default Rundeck SSH node executor.

    Option 1: Use the SSHJ node executor instead of the "SSH" default node executor. To do so, go to the Project > Project Settings (left menu) > Edit Configuration > Default Node Executor/File Copier (tabs) and select SSHJ (on both tabs).

    Option 2: In your remote SSH server, edit the sshd_config file and add this:

    PublickeyAcceptedKeysTypes +ssh-rsa

    Then, restart the SSH service.