Table of Contents
Enabling SSH Tunneling
Tunneling is used for many things. One example is creating a tunnel to access your database on the Accelerator from your machine. This is using MySQL as an example to prove that tunneling is working successfully.
Editing configuration files
- Edit /etc/ssh/sshd_config
- Change the following parameters to “Yes”:
AllowTcpForwarding yes GatewayPorts yes
- restart SSH
# svcadm restart svc:/network/ssh:default
- Checking to ensure that SSH properly restarted:
# svcs -a | grep -i ssh online 21:31:42 svc:/network/ssh:default
The “21:31:42” is the time at which it last changed state, in this case, the time at which we restarted it.
- Make sure the MySQL Server is configured to accept non-localhost connections. Edit /opt/local/etc/my.cnf
- Make sure the following line is commented out (precede with a #)
#skip-networking
- Restart MySQL
mysqladmin shutdown -u root -p
Testing it out
- First lets create the tunnel from local:3307 to remote:3306
- ssh -L3307:127.0.0.1:3306 -p 22 -N -t -x user@myhost.com
- Then lets see if we can connect to the MySQL database on our Accelerator
- mysql -u USER -pPASSWORD -h 127.0.0.1 -P 3307