| Knowledgebase Home | Glossary | Favorites |
| SSH Tunneling | ||||||||||
Table of ContentsBasics of SSH TunnelingAn SSH tunnel works by forwarding a TCP port on a workstation to another TCP port on a server. When forwarding, some information is needed when performing a basic SSH tunnel:
A Simple TunnelOnce this information is obtained the following command can be used to create a tunnel:ssh user@ssh.server -L local_port:host.server:host_portWith actual information: $ ssh demo@199.104.126.75 -L 3307:db1.slc1.stackable.com:3306This command forwards port 3307 on the local machine to db1.slc1.stackable.com using port 3306 using the remote SSH server at 199.104.126.75 Using With MySQLA common use for SSH tunneling is creating a secure connection to a MySQL server. Since Stackable containers and database servers are on a secure internal network, an SSH tunnel can be used on any workstation to create a secure connection to the database server:First create the tunnel: $ ssh demo@199.104.126.75 -L 3307:db1.slc1.stackable.com:3306Now we use MySQL from the command line as usual except we need to tell it to use port 3307 and IP address localhost for the host: $ mysql -h localhost -P 3307 -u db_9uq0ks0 -pThese commands connect to the MySQL server db1.slc1.stackable.com from the container located at 199.104.126.75 and then tunnel that connection to the workstation on port 3307. |
| Visitor Comments |
|
| Related Articles |
| No related articles were found. |
| Attachments |
| No attachments were found. |