I need to access a MySQL database on a remote server at my lab. The server is only accessible once I log in to a gateway server on the remote network:
local serv
With the command:
$ ssh -f user@gateway -L 3307:1.2.3.4:3306 -N
This states that all connections to client localhost 3307 will be forwarded via the SSH tunnel to gateway and then connected to host 1.2.3.4 to port 3306.
edit: If the SSH is on port 24222 then
$ ssh -f user@gateway -p 24222 -L 3307:1.2.3.4:3306 -N