概述
golang实现telnet效果发现ssh异常,在正常的linux是没问题在wsl下提示如下异常
env
- window11 wsl2.0
- golang
异常信息
open failed: administratively prohibited: open failed
解决
vim /etc/ssh/sshd_config
# 允许ssh转发tcp端口
AllowTcpForwarding yes
systemctl restart sshd
//ssh端口转发
ssh -L 1234:localhost:1234 [email protected]
[bang@0201221459-NB ~]$ ss -lant |grep 1234
LISTEN 0 128 127.0.0.1:1234 0.0.0.0:*
LISTEN 0 128 [::1]:1234 [::]:*
link
- https://qastack.cn/unix/14160/ssh-tunneling-error-channel-1-open-failed-administratively-prohibited-open
- https://serverfault.com/questions/535412/how-to-solve-the-open-failed-administratively-prohibited-open-failed-when-us