0

We have server with installed autossh

Number of tunnels approximately 20

Today we add new tunnel, but it doesn't work.

If we switch positioning of [email protected] and [email protected], the one that comes first will work, the other not.

For example

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.1:80:5.6.7.8:80 [email protected] # work fine

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.2:80:1.2.3.4:80 [email protected] # not work 

if we change line

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.2:80:1.2.3.4:80 [email protected] # work fine

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.1:80:5.6.7.8:80 [email protected] # not work

In /var/log we have no error.

When we check listen port using command netstat -tan | grep LISTEN

Last tunnel does not show up.

May this be a connection limit?

2
  • I wolud try to connect manually to the connection that did not work after startup of autossh is finished.
    – xx4h
    Commented May 22, 2018 at 9:33
  • Add manual ssh tunnel with command ssh -f -N -L 192.168.0.1:80:1.2.3.4:80 [email protected] -p 22 -i /home/user/.ssh/my_key Work fine, but autoshh does not work if add to /etc/autossh.hosts
    – useresxi
    Commented May 22, 2018 at 13:26

1 Answer 1

0

I solved the problem.

Instead configuration file /etc/autossh.hosts added to /etc/rc.local the following line:

autossh -fNL 192.168.0.1:80:1.2.3.4:80 [email protected] -p 22 -i /home/user/.ssh/my_key

Tunnel ssh work fine.

You must log in to answer this question.

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