====== 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 and CouchDB as examples 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 Should GatewayPorts turned back to no once we don't need the tunneling anymore or is it fine to leave it to yes for practical reasons? - 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. I'm not using MySQL there but isn't there an error here ? Won't commenting skip-networking let anyone connect directly through 3306, without needing any ssh tunneling ? - 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 ===== ==== MySQL ==== - 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 ==== CouchDB ==== - Create the tunnel from local:5985 to remote:5984 - ssh -L5985:127.0.0.1:5984 -p 22 -N -t -x user@myhost.com - Fire up your browser to http://127.0.0.1:5985/_utils/ and enjoy Futon!