Jenkins node - Unable to stablish an SSH connection between Control Server and Agent node

I have a Jenkins control server hosted in a Ubuntu EC2 instance as part of a training course, in one of the steps we are asked to have another EC2 instance to which we will make it an Jenkins Agent/Node and setup the configuration so the Control Server can connect to it via SSH.

I can ssh to the jenkins agent to be just fine…but the connection from the control server fails with the following errors on the agent side…

sshd[7732]: Address 3.179.225.65 maps to ec2-3-224-65-179.compute-1.amazonaws.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

sshd[7732]: error: AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys ec2-user SHA256:ibr0KqNxxw4l8QZcIoYrk+f7P0uq9nwWxtbe0mAibr failed, status 22

sshd[7732]: error: AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys ec2-user SHA256:ibr0KqNxxw4l8QZcINDXX+f7P0uq9nwWxtbe0mAibr failed, status 22

sshd[7732]: error: AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys ec2-user SHA256:ibr0KqNxxw4fIoYrkNDXX+f7P0uq9nwWxtbe0mAibr failed, status 22

sshd[7732]: Received disconnect from 3.179.225.65 port 56838:11: Closed due to user request. [preauth]

sshd[7732]: Disconnected from 3.179.225.65 port 56838 [preauth]

We were instructed to use the -Non verifying verification strategy for
Host Key Verification Strategy ?

I have tried exhaustingly various solutions offered by other on the internet… but non have worked for me yet.
Any assistance on how to get to the root cause of this issue will be greatly appreciated.

Hello @DFranc-D and welcome to this community :wave:

I had some problems in the past with setting up a Jenkins agent via ssh, but managed to do it with the latest version of this documentation:

To me, it looks like the key is not well configured.

Would that documentation help in any way?