I am unable to SSH to the Ubuntu EC2 instance on AWS from macOS terminal.
Tried the following cmd from the terminal :

ssh ubuntu@ec2-13-127-143-37.ap-south-1.compute.amazonaws.com

And

ssh 13.127.143.37@ec2-13-127-143-37.ap-south-1.compute.amazonaws.com
both are giving the same error: Permission denied (publickey).

I tried generating the public key using ssh-keygen and imported it under the key pair options on AWS, but still getting the same error.

Please help me with this.

Thanks,
Nidhi Arora