ssh登录异常

概述

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 bang@127.0.0.1

[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

posted @ 2023-01-18 18:22  mvpbang  阅读(233)  评论(0编辑  收藏  举报