Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to reverse tunnel connection to my SunOS (Joyent) so that any connections coming to 12043 on this server will be served by my local development server running at localhost:8843.

Edit: I don't know why but SO is not formatting my post properly (damn). Any experienced guy please help edit my post

So here what I do:

  1. Start my local server at port 8843

    $ telnet localhost 8843
    Connected to localhost.
    Escape character is '^]'.

  2. Connect to server

    $ ssh -vgR *:12043:
    OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009 debug1: Reading configuration data /x/x/.ssh/config debug1: Reading configuration data /etc/ssh_config debug1: Connecting to [x.x.x.x] port 22. debug1: Connection established. debug1: identity file /x/x/.ssh/identity type -1 debug1: identity file /x/x/.ssh/id_rsa type 1 debug1: identity file /x/x/.ssh/id_dsa type 2 debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.4 debug1: no match: Sun_SSH_1.4 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.2 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host '' is known and matches the RSA host key. debug1: Found key in /x/x/.ssh/known_hosts:65 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering public key: eastagile5 debug1: Server accepts key: pkalg ssh-dss blen 433 debug1: Authentication succeeded (publickey). debug1: Remote connections from *:12043 forwarded to local address debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: remote forward success for: listen 12043, connect debug1: All remote forwarding requests processed Last login: Wed Mar 30 09:47:43 2011 from y.y.y

  3. Then do a check

    $ telnet 12043
    Trying x.x.x.x...
    telnet: connect to address x.x.x.x: Connection refused
    telnet: Unable to connect to remote host

share|improve this question

Try replacing with the IP you actually want the connection to be forwarded to. E.g.:

ssh -vgR *:12043:localhost:8843
share|improve this answer
Shouldn't your localhost be the name of the remote server? – Decado Mar 30 '11 at 10:38

Have you checked your servers sshd_config?

I have not worked with solaris myself in some time however you must have

GatewayPorts yes

For this to work, in RHEL and derived distros (CentOS etc...)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.