vscode 遠程調試

1. SSH
安裝兼容 OpenSSH 的 SSH 客戶端Windows, 安裝 Git for Windows 便可,https://git-scm.com/download/win
win安裝ssh服務端 freesshd
https://blog.csdn.net/qq_36249516/article/details/77987144?utm_source=blogxgwz9
2.插件
Remote Development擴展,只用安裝這個插件,其餘的依賴包會自動下載。python


打開命令行,並輸入 ssh 字樣,按照下圖中第二步選擇 Remote-SSH:Connet to Host...
 
輸入鏈接到遠程主機的用戶名和 ip linux

鏈接成功後會另外再打開一個新的窗口 git


右下角
 

打開後,visual studio code會自動在遠程PC上,安裝配置服務器

要root權限ssh

 


2、保存常常鏈接的主機信息
 
Host root@192.168.1.100            #由於bug HOST必須這樣寫
    User root
    HostName 192.168.1.100
#    Port  自定義端口22ide

Host example-remote-linux-machine-with-identity-file
    User your-user-name-on-host
    HostName another-host-fqdn-or-ip-goes-here
    IdentityFile ~/.ssh/id_rsa-remote-sshspa

再次打開遠程鏈接到遠程主機
.net

以前在 SSH 配置文件中配置過的主機會出如今主機列表中
 
選擇相應的主機便可再次鏈接到遠程主機插件

 

以python爲例命令行

3、
新建文件保存到
 
或者打開遠程文件夾

4、
1.服務器上語言的編譯環境

2.安裝語言對應插件到遠程電腦

 

5、調試

由於python最簡單,直接點調試就能夠了
 

相關文章
相關標籤/搜索