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_address
will only succeed if the server'sGatewayPorts
option is enabled (seesshd_config(5)
).
Em seguida, man 5 sshd_config
diz:
GatewayPorts
Specifies 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.GatewayPorts
can be used to specify thatsshd
should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect. The argument may beno
to force remote port forwardings to be available to the local host only,yes
to force remote port forwardings to bind to the wildcard address, orclientspecified
to 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 clientspecified
emsshd_config
no servidor (e reinicie / recarregue o daemon, consulte Existe algum backup? para configuraçãossh
, para reverter o erro? , Reiniciandosshd
sempre 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_address
deport
).