当前位置:网站首页>WingIDE 7.2.0 远程调试
WingIDE 7.2.0 远程调试
2022-08-05 11:34:00 【为为为什么】
大型程序常常会运行在性能强劲的服务器上,但是此时程序的调试又成了难办的事情,于是产生了远程调试的需求,本文介绍WingIDE远程调试配置方法。
环境描述
- WingIDE 版本需求 6./ 7. ,我的是 7.2.0
- 本地操作系统 Win10
- 远程服务器操作系统 Ubuntu 16.04
- 安装 putty
- 解决方案:使用ssh协议通信,实现远程调试
环境配置
安装SSH服务
查看服务是否安装:
sudo ps -e |grep ssh返回带有 sshd 的条目即为已经安装
$ ps -e |grep ssh
37 ? 00:00:00 sshd
16013 ? 00:00:00 sshd
16588 ? 00:00:00 sshd否则安装SSH服务
sudo apt-get install openssh-server生成SSH密钥对
在本地Win10(运行wingIDE的环境)使用ssh-keygen生成SSH密钥
$ ssh-keygen -t rsa此时在 C -> Users -> Admin(用户名) -> .ssh 文件夹下会生成
id_rsa和id_rsa.pub两个密钥文件,其中id_rsa为私钥,无论如何不能交给别人。
远程主机配置SSH密钥
将刚刚生成的公钥文件
id_rsa.pub复制到远程主机~/.ssh文件夹中,并添加到~/.ssh/authorized_keys里。 假设你的id_rsa.pub文件在.ssh文件夹中而且名称为rsa_temp.pub
cat ~/.ssh/rsa_temp.pub >> ~/.ssh/authorized_keys
rm ~/.ssh/rsa_temp.pub此时你的本机Win10系统ssh连接远程主机已经不再需要输入密码进行身份验证。 可以使用ssh命令测试是否配置成功,过程中询问是否继续连接,输入
yes即可:
ssh -p 3722 [email protected] #-p为端口 一般来说ssh常用端口默认是22
----->
The authenticity of host '[192.168.10.80]:3722 ([192.168.10.80]:3722)' can't be established.
ECDSA key fingerprint is SHA256:qCIsaqEa6wNy0daSgBxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[192.168.10.80]:3722' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Last login: Thu May 14 08:20:47 2020 from 192.168.10.213
* Starting OpenBSD Secure Shell server sshd [ OK ]
[email protected]:~#
此时我们已经可以用SSH连接两个操作系统,即已经完成了理论层面的配置,接下来进入具体操作阶段。
远程调试配置
此处解释一下,WingIDE在连接远程服务器时需要配置连接信息,而这个信息可以在putty中保存,也就是说,只要putty中保存的参数可以连接成功,那么这套配置就可以用于wingIDE的远程调试。
私钥文件id_rsa转换成putty的ppk格式
putty需要ppk格式的私钥文件,生成方法如下:
- 运行puttygen (在putty同位置文件夹内)
- 选择
Conversions菜单项中的Import key选项:
- 选择生成的id_rsa文件
- 在puttygen的界面上点击
Save private key按钮就可以把私钥转换为ppk的格式了(不要点Generate)
在putty配置远程连接信息
打开putty
- 配置 Session :
主要配置IP和端口号,在Saved Sessions里配置可以区分的名字,之后供WingIDE调用
- 配置 Connection-Data选项卡,在自动登录用户名处填入需要自动登录的用户名(我的是root)
- 配置 Connection-SSH-Auth选项卡,浏览选择刚刚生成的私钥ppk文件:
- 回到Session,点击
Save保存当前配置到test_3722中:
- 此后每次打开putty双击我们的
test_3722即可连接到远程服务器:
配置WingIDE
距离成功仅一步之遥。 打开WingIDE, Project -> New Project
其中 Identifier 为该工程的名称, Host Name为我们刚刚保存的Putty名称,点击
OK。
- 此时可以选择保存工程,也可以一会再说
- 在远程的默认python路径往往不是我们需要的,我的常用python在conda的一个自建的环境中,可以指定其为wingIDE的默认远程python环境:
- 随后一路OK,出现此对话框说明配置成功:
- 重启python shell 可以在本地看到远程的python shell:
- 可以简单通过操作系统验证是否配置成远程python
- 在project中可以加入远程的工程
可以本地修改远程代码,并运行调试:
边栏推荐
猜你喜欢
随机推荐
Gray value and thermal imaging understanding
Gao Zelong attended the Boao Global Tourism Ecology Conference to talk about Metaverse and Future Network Technology
PG优化篇--执行计划相关项
lvgl 实现状态提示图标自动对齐补位显示
The fuse: OAuth 2.0 four authorized login methods must read
Detailed explanation of PPOCR detector configuration file parameters
Introduction to the Evolution of Data Governance System
nyoj757 期末考试 (优先队列)
Flink Yarn Per Job - JobManger 申请 Slot
张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
EOS的共识机制与区块生成
hdu4545 Magic String
Machine Learning - Logistic Regression
STM32 entry development: write XPT2046 resistive touch screen driver (analog SPI)
“蘑菇书”是怎样磨出来的?
Learning Deep Compact Image Representations for Visual Tracking
UDP通信
5G NR 系统消息
祝所有码农七夕快乐~
Exploration and practice of transaction link under multi-service mode









