0

Is there a way for me to connect remotely to a database running on AWS EC2 without using SSH tunnelling?

I need to provide remote database access to an user without giving him access to the EC2 instance.

I already have inbound rule set to allow all. I'm able to connect if i set the connection method to SSH.

enter image description here

Avery235
  • 4,756
  • 12
  • 49
  • 83
  • Possible duplicate of [Connect to mysql on Amazon EC2 from a remote server](https://stackoverflow.com/questions/9766014/connect-to-mysql-on-amazon-ec2-from-a-remote-server) – marcell Dec 23 '17 at 15:58
  • Is your database in a Public Subnet or a Private Subnet? Would you be willing to launch a different EC2 instance for port forwarding (eg a t2.nano)? What is your Security Group configuration? Feel free to Edit your question to provide additional details. – John Rotenstein Dec 24 '17 at 01:16

1 Answers1

4

If the EC2 instance is in a public subnet, opening up port 3306 to the user should be enough to allow access.

If the instance is in a private subnet, but you don't want to set up a tunnel, you could create a load balancer (either ELB classic or the new Network Load Balancer) in the public subnet, and use TCP forwarding to the database - the user could connect to the port on the LB.

jarmod
  • 71,565
  • 16
  • 115
  • 122
chris
  • 36,094
  • 53
  • 157
  • 237