My situation: I want to remotely debug my c++ application with gdbserver and eclipse. Eclipse is running on my local workstation (in the 192.168.0.0 network) and gdbserver is running on a clustermachine in the 10.0.0.0 network. I have ssh access to the clustermachine via a machine that is in both networks.
How can I set up a tunnel so that my eclipse can access the gdbserver? I don't have administrator rights/root/sudo access.
All the machines are linux/Unix with openssh.
I trust you can already SSH to a system on the remote private network (10.0.0.0). If your local system is running openssh, add to your
$HOME/.ssh/config
:Where 'remote_ip' is the IP address of the remote clustermachine system where gdbserver runs, and portnum is the port that it listens on. SSH to gatewaymachine, then connect your application to localhost, port 12080. For example if this is a web application
If you're not using a web application, you'll need to set up your connection information to reflect that you're going to 'localhost' port '12080' (or whatever port you like, see below).
Instead of editing your ssh config, you can also use ssh command parameters:
(change 12080 to whatever port you want above 1024; below 1024 and you'll need root access to bind to the port)
Basically, what jtimberman said :). You might want to look into autossh if you have trouble keeping your tunnel up for extended periods of time.