Monday, October 10, 2011

ssh tunneling to access remote mysql on ec2

to acess remote mysql on ec2 as local on port 3307 using ssh tunneling we can use following command(assuming port is close on remote machine),

ssh -i -L 3307:localhost:3306 username@server

This command can be used to acces any other kind of service by changing port number

login as another using sudo

use

sudo -u bash

to login into bash as another user