Forward local port or socket file to remote socket file

Posted by Ninefingers on Server Fault See other posts from Server Fault or by Ninefingers
Published on 2010-03-30T17:51:08Z Indexed on 2010/03/30 17:53 UTC
Read the original article Hit count: 800

Filed under:
|
|
|

Hi All,

Quick question - I run two linux boxes, one my own desktop and the other my VPS. For security reasons on the VPS end I opted for socket connections to MySQL (/var/run/mysqld/mysql.sock). I know I can tunnel like this: ssh -L 3307:127.0.0.1:3306 [email protected] if I set up the remote sql server to listen on some port, but what I want to know is can I do something like: ssh -L /path/to/myremotesqlserver.sock:/var/run/mysqld/mysql.sock thereby tunnelling two sockets, as opposed to two ports?

A perfectly acceptable solution would also be to forward a local port to the remote socket file, but where possible I'm trying not to have tcp servers running on the remote box.

(and yes, I know tcp would be easier).

Thanks all,

Nf.

© Server Fault or respective owner

Related posts about ssh

Related posts about port-forwarding