ssh -R 命令的bind_address没有指定0.0.0.0 或 \*
GatewayPorts yes
两种情况都在ssh文档里说明了,$ man ssh:
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 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))
如果我们在命令里已经指定了0.0.0.0或\*,那我们再修改下sshd_config的GatewayPorts yes。
重启下sshd,然后重新运行命令就会发现已经是
[zxsq-anti-bbcode-timest@iZbp147cvofre8y3kd1l3xZ ~]$ netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4444 0.0.0.0:* LISTEN
tcp6 0 0 :::3690 :::* LISTEN