Search code examples
amazon-web-servicessshamazon-rdstunneling

Trying to connect to RDS instance through my ec2 instance from my local machine and coming up with the following error


Tried connecting to the rds instance through the ec2 instance from and my local machine coming up with an error saying "Permission denied (public key)"

ssh -L 3306:db_instance_name.cxtitvmupc3w.us-west-2.rds.amazonaws.com:3306 my_instance_ip


Permission denied(public key)

Solution

  • This is ssh saying that you have not provided a private key to establish the ssh session.

    You would normally include -i keyfile.pem in the command, exactly the same way you would normally ssh to the instance.