CONFIGURE SQLYOG TO CONNECT TO A DATABASE THROUGH AN SSH TUNNEL
KEYWORDS
sqlyog, sql yog, ssh, encryption, vpn alternative, ssh tunnel, mariadb, mysql, authentication
SUMMARY
Outside connections to databases can be a real pain as databases should not be directly addressed by the general internet. Databases sit behind a firewall and are accessed normally through web browsers that connect to web servers, which in turn connect to app servers, which then connect to databases.
To access databases from the general internet, one must bypass the firewall. A couple of ways of doing that (and there are other ways) are to use a VPN (Virtual Private Network) or use an SSH (Secure SHell) Tunnel. Tunnel implies a secure connection.
Both of these methods bypass the firewall and encrypts the connection to insure the connection remains secure. Both methods take some upfront setup. VPN in installing the software and the VPN keys. SSH is generating the SSH keys.
The scope here is how to get started with SSH within SQLyog. The SSH Tunnel is really just the first of two connections to the database. The first connection is a network connection from the client side to the SSH Relay Host (SSH Tunnel Host, or several other names) to bypass the firewall. Then there is a normal database connection from the SSH Relay Host to the database server/s.
GENERATE SSH KEYS
|
|
|
CONFIGURE SSH TUNNEL SERVER
- This is as exercise outside the scope of this blog.
TEST SSH TUNNEL
- To test the ssh tunnel, launch putty
- Enter the SSH Host Address in the Host Name (or IP address) field
- In the Connection/Data screen, add an Auto-login username.
- In the Connection/SSH/Auth screen, add a path to Private key file for authentication that references your private key (.ppk).
- In the Session screen, click [Open]
- You should be logged in after optionally entering the password that encrypts your private key.
SQLYOG CONNECTION