VSCODE的remote-ssh没想到这么好用
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
,如果你的代码在服务器上,不想将服务器代码下下来而是远程调试。可以通过这个插件代替vim
的功能,编辑和运行服务器上的代码,还可以远程debug(C++和python都可以)。
简单的使用教程:
首先我们找到VSCODE中Remote-SSD
插件并下载:
此时可以看到VSCode左方图标栏中多了一个远程服务器的图标,我们打开这个界面,点击设置图标:
点击第一项设置config
。
然后设置我们需要连接的服务器名称、服务器地址以及服务器用户名和端口Port(端口可以不指定,默认都是22)。
设置好之后就可以看到remote-ssd那个插件栏出现了很多服务器的列表,选择一个进行连接吧。
输入密码,点击进去服务器之后就可以为所欲为了嘎嘎。
还可以和本地一样安装插件嘎嘎(下去使用VSCode连上服务器插件也都在)。
如果连不上
有时候会出现死活连不上的情况,这个时候最直接简单的解决方法:
通过命令行的方式连接这个服务器ssh [email protected]
,然后删除home下的.vscode-server
文件夹重试即可。
Apple M1
Apple M1 的VSCode可以正常使用,目前我使用的是Code - Exploration
版本,Remote-SSH
也可以正常使用,目前没有出现什么问题…
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK