In your ssh command, you are not specifying a bind_address
for your -L
option.
According to man ssh
:
By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of ''localhost'' indicates that the listening port be bound for local use only, while an empty address or '*' indicates that the port should be available from all interfaces.
By default, the local port is bound in accordance with the
GatewayPorts
setting. However, an explicitbind_address
may be used to bind the connection to a specific address. Thebind_address
oflocalhost
indicates that the listening port be bound for local use only, while an empty address or*
indicates that the port should be available from all interfaces.
To allow connections on all interfaces and not just localhost
(which is an alias for 127.0.0.1
, the address of the loopback interface), specify a bind_address
of 0.0.0.0
in your -L
option, e.g.
sudo ssh -L 0.0.0.0:140:localhost:8000 [email protected] -N
If you would prefer it listen on a particular IP, you can specify it instead of 0.0.0.0
.