1

I have to access an openvpn-vpn server behind a firewall, so to do this I use an ssh-reverse tunnel. While using the "normal" ssh command works, connecting via autossh does not. For all the other connections autossh works fine.

  • SSH-Command:

    ssh -R 0.0.0.0:8888:localhost:1194 user@server -N
    
  • Autossh-Command:

    /usr/bin/autossh -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -N -R 0.0.0.0:8888:localhost:1149 user@server
    
  • Error message while trying to connect with autossh:

    debug1: connect_next: host localhost ([127.0.0.1]:1149) in progress, fd=7
    debug3: channel 2: waiting for connection
    debug1: channel 2: connection failed: Connection refused
    connect_to localhost port 1149: failed.
    debug3: send packet: type 92
    debug2: channel 2: zombie
    debug2: channel 2: garbage collecting
    debug1: channel 2: free: 193.175.84.201, nchannels 3
    debug3: channel 2: status: The following connections are open:
    

I don't know what the difference might be here, anyone knows what could be wrong?

1 Answer 1

1

Found the solution, for anyone who has the same problem:

Instead of:

/usr/bin/autossh -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -N -R 0.0.0.0:8888:localhost:1149 user@server

The command needs to be like this:

/usr/bin/autossh -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -R 0.0.0.0:8888:localhost:1194 user@server -N

So the -N option needs to be at the end.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.