一、问题
通过pycharm远程连接服务器时,可以run,但是不可以debug,出现如下问题:While creating remote tunnel for SshjSshConnection(root@173.19.59.9)@6ac8d3d0: localhost:55453 == localhost:43023: Global request [global req for tcpip-forward] failed。
二、问题解决
(1)排除错误,首先本地的python解释器是可以debug的
(2)网络上很多解决方案都是关于什么pycharm的某个插件,但是看回答是pycharm2019.2版本的,而新的pycharm版本根本就没有这个东西,所以问题也不是在这。
(3)实际上,排除本地的问题,那么很有可能是服务器端的问题
解决:修改sshd配置文件
(1)vim /etc/ssh/sshd_config
(2)看看AllowTcpForwarding
后面是yes
还是no
,如果是no
把改为yes
,否则可能是其它问题。
(3)重启sshd服务,注意,一定要重启。systemctl restart sshd.service
,网络上重启sshd命令挺多,如果不成功多试几个命令。