Quando você se conecta a partir do seu servidor ASW, conecta-se a localhost . Observe o que man 1 ssh diz:
-R [bind_address:]port:host:hostport[…]
By default, the listening socket on the server will be bound to the loopback interface only. This may be overridden by specifying a
bind_address. An emptybind_address, or the address*, indicates that the remote socket should listen on all interfaces. Specifying a remotebind_addresswill only succeed if the server'sGatewayPortsoption is enabled (seesshd_config(5)).
Em seguida, man 5 sshd_config diz:
GatewayPortsSpecifies whether remote hosts are allowed to connect to ports forwarded for the client. By default,
sshd(8)binds remote port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports.GatewayPortscan be used to specify thatsshdshould allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect. The argument may benoto force remote port forwardings to be available to the local host only,yesto force remote port forwardings to bind to the wildcard address, orclientspecifiedto allow the client to select the address to which the forwarding is bound. The default isno.
Para que funcione, você deve fazer algo assim:
- inclua
GatewayPorts clientspecifiedemsshd_configno servidor (e reinicie / recarregue o daemon, consulte Existe algum backup? para configuraçãossh, para reverter o erro? , Reiniciandosshdsempre manter as sessões existentes ativas? e Reinicie o SSH em uma máquina onde o SSH é o único modo de acesso ); - conecte-se com
ssh … -R :22222:localhost:22 …do Raspberry (observe o primeiro:, ele separa o% vaziobind_addressdeport).