Build Agent Connection Failure

I am getting the following error while adding a build agent

SSHLauncher{host='34.204.81.212', port=22, credentialsId='b86b1800-56e6-4c2e-8fe9-74dccd57c595', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[01/30/23 03:05:45] [SSH] Opening SSH connection to 34.204.81.212:22.
[01/30/23 03:05:45] [SSH] SSH host key matches key seen previously for this host. Connection will be allowed.
[01/30/23 03:05:45] [SSH] Authentication failed.
Authentication failed.
[01/30/23 03:05:45] Launch failed - cleaning up connection
[01/30/23 03:05:45] [SSH] Connection closed.

I have added newuser on build-agent node:

root@ip-172-31-51-203:/home/newuser# cd
root@ip-172-31-51-203:~# groups newuser
newuser : newuser sudo
root@ip-172-31-51-203:~#

Security group has all traffic on all ports

on Jenkins server
Try

su - jenkins  
ssh [email protected]

then check it again

Hi @yashvgec1618,
By default, AWS doesn’t authorize login/password access by ssh he uses public/private key authentication.
Instead of using password auth you can create a public/private key for newuser user and configure the private on Jenkins

Another option is to activate PasswordAuthentication

Capture d’écran du 2023-01-30 23-06-36