- 安装VScode
- 安装插件 : Remote-SSH, Python
- 设置SSH config,填写需要连接的服务器信息
Host 自己起的名字
HostName 服务器IP
User 登录名
删除服务器~目录下的.vscode-server,mkdir 新的.vscode-server,按步骤登录
- 由于网络原因,若服务器无法下载.vscode-server,可能会报错"VS Code配置并连接远程服务器报错,Error: Running the contributed command: '_workbench.downloadResource' failed"
解决方案 :
找到报错日志里面的commit id :xxxxxxxxxxxxxxxxx
或者在~ 目录下,~/.vscode-server/bin/ 下会有对应的commit id,下载失败会出现commit id下没有对应的软件文件,记住这个id,手动下载文件(替换掉commit id)
https://update.code.visualstudio.com/commit:自己的commit id /server-linux-x64/stable
下载完毕后,将下载的文件mv到服务器的 ~/.vscode-server/bin/CommitId/ 文件夹下,同时删除其他文件,最后再使用tar -xvf vscode-server-linux-x64.tar.gz --strip-components 1解压文件
- 配置免密码登录
Windows下生成pubKey
Dos下输入 : ssh-keygen, 一直回车,会在对应路径下生成公钥id_rsa.pub和私钥id_rsa
step 1 : 将公钥里的内容copy到服务器 ~/.shh/authorized_keys 下
step 2 : 将Win主机下私钥的路径添加到配置中
在remote 的 ssh config下新增 :
IdentityFile "C:\Users\XXX.ssh\id_rsa"
vscode 解决正在下载程序包“C/C++ language components (Linux / x86_64)” 失败引起的符号找不到问题
https://github.com/microsoft/vscode-cpptools/releases/tag/1.7.0-insiders2
VS Code中C/C++ 无法跳转到定义的解决办法【有效】
解决C++代码在VSCode中无法快速跳转的问题。
颜色主题 : Ctrl P -> color theme