Iniciando autossh como: autossh -M 5122 -N -R 5432:localhost:5432 <user>@<myhost>
, no puedo conectarme a localhost: 5432. Si ejecuto ssh -f <user>@<myhost> -L 5432:localhost:5432 -N -v -v
, puedo.
La salida de autossh:
debug1: Local connections to LOCALHOST:5122 forwarded to remote address 127.0.0.1:5122
debug1: Local forwarding listening on ::1 port 5122.
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 5122.
debug2: fd 7 setting O_NONBLOCK
debug1: channel 1: new [port listener]
debug1: Remote connections from LOCALHOST:5122 forwarded to local address 127.0.0.1:5123
debug1: Remote connections from LOCALHOST:5432 forwarded to local address localhost:5432
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: remote forward success for: listen 5122, connect 127.0.0.1:5123
debug1: remote forward success for: listen 5432, connect localhost:5432
debug1: All remote forwarding requests processed
Y desde ssh:
debug1: Local connections to LOCALHOST:5432 forwarded to remote address localhost:5432
debug1: Local forwarding listening on ::1 port 5432.
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 5432.
debug2: fd 7 setting O_NONBLOCK
debug1: channel 1: new [port listener]
debug1: Requesting [email protected]
debug1: forking to background
debug1: Entering interactive session.
Hace poco comencé a jugar con ssh tunneling y no puedo entender por qué autossh solo reenviará el puerto 5122.