我正在尝试通过端口转发进行 ssh。这是我的 ssh 配置文件:
HOST A
HostName B
user C
DynamicForward 0.0.0.0:1081
当我运行“ssh A”时,我得到:
channel 5: open failed: administratively prohibited: open failed
channel 7: open failed: administratively prohibited: open failed
channel 10: open failed: administratively prohibited: open failed
channel 12: open failed: administratively prohibited: open failed
....
我见过类似的问题,并在我的服务器的 ssh 配置中测试了这些标志,但没有一个起作用:
PermitTunnel yes
AllowTcpForwarding yes
AllowTunnel yes
PermitOpen yes
这是“ssh -v A”的结果:
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 5: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 6: new [dynamic-tcpip]
channel 5: open failed: administratively prohibited: open failed
debug1: channel 5: free: direct-tcpip: listening port 1081 for 2001:b28:f23f:f005::a port 443, connect from 127.0.0.1 port 53584 to 127.0.0.1 port 1081, nchannels 7
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 5: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 7: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 8: new [dynamic-tcpip]
channel 7: open failed: administratively prohibited: open failed
debug1: channel 7: free: direct-tcpip: listening port 1081 for 2001:b28:f23f:f005::a port 443, connect from 127.0.0.1 port 53590 to 127.0.0.1 port 1081, nchannels 9
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 7: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 9: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 10: new [dynamic-tcpip]
channel 9: open failed: administratively prohibited: open failed
debug1: channel 9: free: direct-tcpip: listening port 1081 for 2001:b28:f23d:f001::a port 443, connect from 127.0.0.1 port 53596 to 127.0.0.1 port 1081, nchannels 11
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 9: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 11: new [dynamic-tcpip]
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 12: new [dynamic-tcpip]
channel 11: open failed: administratively prohibited: open failed
debug1: channel 11: free: direct-tcpip: listening port 1081 for 2001:b28:f23d:f001::a port 443, connect from 127.0.0.1 port 53602 to 127.0.0.1 port 1081, nchannels 13
debug1: Connection to port 1081 forwarding to socks port 0 requested.
debug1: channel 11: new [dynamic-tcpip]
这是我的 sshd_config 文件:
ChallengeResponseAuthentication no
UsePAM yes
AllowTcpForwarding yes
X11Forwarding yes
PrintMotd no
Banner /etc/issue.net
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
ClientAliveInterval 120
PasswordAuthentication yes