因此,我编写了一个 Java 应用程序,以反向方式 (-R) 连接到服务器,并创建一个执行它的 ssh 服务器,以便服务器可以在执行我的应用程序的客户端中执行命令。这部分工作得很好。问题是我想在服务器中创建一个 SOCKS 代理并通过客户端隧道传输流量。我使用的命令是:
ssh -vvv -f -D 0.0.0.0:8080 localhost -p 11707 -N
我收到此错误:
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug2: fd 5 setting TCP_NODELAY
debug2: fd 5 setting O_NONBLOCK
debug3: fd 5 is O_NONBLOCK
debug1: channel 1: new [dynamic-tcpip]
debug2: channel 1: pre_dynamic: have 0
debug2: channel 1: pre_dynamic: have 4
debug2: channel 1: decode socks5
debug2: channel 1: socks5 auth done
debug2: channel 1: pre_dynamic: need more
debug2: channel 1: pre_dynamic: have 0
debug2: channel 1: pre_dynamic: have 25
debug2: channel 1: decode socks5
debug2: channel 1: socks5 post auth
debug2: channel 1: dynamic request: socks5 host www.cualesmiip.com port 80 command 1
channel 1: open failed: administratively prohibited: Connection denied
debug2: channel 1: zombie
debug2: channel 1: garbage collecting
debug1: channel 1: free: direct-tcpip: listening port 8080 for www.cualesmiip.com port 80, connect from 4.174.29.15 port 50879, nchannels 2
debug3: channel 1: status: The following connections are open:
我已在接收连接的 ssh 服务器中进行了AllowTcpForwarding
设置。yes
错误可能出在哪里?谢谢
答案1
在 sshd_config 中将 GatewayPorts 选项设置为 yes。
GatewayPorts 是