Reputation: 525
Does anyone have an idea on steps of setting up an SSH tunnel for the CloudFoundry? I want to do remote debugging on cloud, but am blocked behind a firewall. So need to setup an SSH tunnel for that.
Upvotes: 0
Views: 1543
Reputation: 15081
I wrote a blog post on setting up remote debugging for Java apps on Cloud Foundry. It covers using an SSH Tunnel to work around a firewall / NAT.
The answer from the article is this...
/etc/ssh/sshd_config
, add or set GatewayPorts
to yes
. Restart SSHD.ssh -f -N -T -R 0.0.0.0:<public-port>:127.0.0.1:<debugger-port> <user>@<public-server-ip>
(Windows users can use cygwin or possibly Putty, although the command will be different). This will instruct SSH to connect to the remote host, setup a reverse tunnel and go into the background. The reverse tunnel will listen on your public server on the port you specify (i.e. public-port) and forward traffic to the debugger port on your local machine. You can use different port numbers, but it is easiest if you just use the same port.manifest.yml
file. Set JAVA_OPTS
to -agentlib:jdwp=transport=dt_socket,address=<your-ip>:<your-port>
.For a gentler walk through, see the post.
Upvotes: 2