Auth failed using ssh credential and file secrets with AWS

I’m trying to set up an SSH deployment in AWS and in doing so, I created an ssh credential secret as well as a file secret to hold the pem file. I can connect to the EC2 instance using the ssh CLI from my Linux machine, but trying to test the connection in Harness, The “checking for delegates” passes, but the verifying connection fails with “Auth failed”

Can anyone help me solve this?