3

I have two computers both running Linux. Let's call them computer A and computer B. Computer A has IP 192.168.1.10 and B has 192.168.1.11.

On computer B there is a JBoss 7 AS installed and its admin interface is just accessable locally (on http://127.0.0.1:9990) and I would like to access it from computer A.

Therfor I would like to SSH tunnel to computer B from computer A and forward all traffic to another port that is open on B, let's say I would forward incomming HTTP requests on port 8081 on B to 127.0.0.1:9990.

How can I establish such a tunnel from computer A to computer B?

I followed this guide but failed: http://www.revsys.com/writings/quicktips/ssh-tunnel.html

1 Answer 1

2

On computer A:

ssh -fCNL 8081:localhost:9990 [email protected]

Or reverse port forward from computer B (don't use both simultaneously):

ssh -fCNR 9990:localhost:8081 [email protected]

For understanding the options see man ssh

3
  • Thanks! I will try that tomorrow at work. Will accept the answer tomorrow if I succeed. :-)
    – Rox
    Nov 19, 2012 at 18:08
  • On a normal network the -C option will just slow things down.
    – rorycl
    Nov 19, 2012 at 21:04
  • For me the CPU overhead from -C is negligible. Desktops and servers can handle gzip compression/decompression very easily and embedded devices usually turn off this feature. On the other size, network load is significantly lower especially on port forwarding (often is uncompressed/plaintext data).
    – Dmitry
    Nov 19, 2012 at 22:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .