7

VSCODE的remote-ssh没想到这么好用

 3 years ago
source link: https://oldpan.me/archives/vscode-remote-ssh-easy-use
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

VSCODE的remote-ssh没想到这么好用

Oldpan 2020年11月29日 0条评论 142次阅读 0人点赞

《VSCODE的remote-ssh没想到这么好用》

推荐一个VSCode的插件:Remote-SSH,如果你的代码在服务器上,不想将服务器代码下下来而是远程调试。可以通过这个插件代替vim的功能,编辑和运行服务器上的代码,还可以远程debug(C++和python都可以)。

简单的使用教程:

首先我们找到VSCODE中Remote-SSD插件并下载:

《VSCODE的remote-ssh没想到这么好用》

此时可以看到VSCode左方图标栏中多了一个远程服务器的图标,我们打开这个界面,点击设置图标:

《VSCODE的remote-ssh没想到这么好用》

点击第一项设置config

《VSCODE的remote-ssh没想到这么好用》

然后设置我们需要连接的服务器名称、服务器地址以及服务器用户名和端口Port(端口可以不指定,默认都是22)。

《VSCODE的remote-ssh没想到这么好用》

设置好之后就可以看到remote-ssd那个插件栏出现了很多服务器的列表,选择一个进行连接吧。

《VSCODE的remote-ssh没想到这么好用》

输入密码,点击进去服务器之后就可以为所欲为了嘎嘎。

还可以和本地一样安装插件嘎嘎(下去使用VSCode连上服务器插件也都在)。

《VSCODE的remote-ssh没想到这么好用》

如果连不上

有时候会出现死活连不上的情况,这个时候最直接简单的解决方法:

通过命令行的方式连接这个服务器ssh [email protected],然后删除home下的.vscode-server文件夹重试即可。

Apple M1

Apple M1 的VSCode可以正常使用,目前我使用的是Code - Exploration版本,Remote-SSH也可以正常使用,目前没有出现什么问题…


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK