Portál AbcLinuxu, 12. května 2025 10:25
ssh -f -N -R 8081:localhost:80 root@123.123.123.123ze stroje 123.123.123.123 se na port 8081 dostanu ovšem z když z venku zadám http://123.123.123.123:8081 tak mě to nepřipojí. Kde mám chybu. Předem děkuji za odpovědi.
Řešení dotazu:
ssh -f -N -R 0.0.0.0:8081:localhost:80 root@123.123.123.123+ v konfigu sshd
GateeayPorts clientspecified
Problém tohoto řešení je, že zbytečně omezuje tunel pouze na IPv4. Vhodnější je *
, protože poslouchá i na IPv6.
By default, TCP listening sockets on the server will be bound to the loopback interface only. This may be overridden by specify‐ ing a bind_address. An empty bind_address, or the address ‘*’, indicates that the remote socket should listen on all interfaces. Specifying a remote bind_address will only succeed if the server's GatewayPorts option is enabled (see sshd_config(5)).Takže by stálo za to, zkusit:
ssh -f -N -R '*:8081:localhost:80 root@123.123.123.123'
By default, TCP listening sockets on the server will be bound to the loopback interface only. This may be overridden by specify‐ ing a bind_address. An empty bind_address, or the address ‘*’, indicates that the remote socket should listen on all interfaces. Specifying a remote bind_address will only succeed if the server's GatewayPorts option is enabled (see sshd_config(5)).Takže by stálo za to, zkusit:
ssh -f -N -R '*:8081:localhost:80' root@123.123.123.123
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.