win10 使用 VSCode 编辑ubuntu

win10 使用 VSCode 编辑ubuntu

1、vscode版本
下载地址:https://code.visualstudio.com/insiders/

版本: 1.36.0-insider (user setup)
提交: e80dd4f217db6e230d311a87fdf4276f740f6445
日期: 2019-06-25T05:19:01.461Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0

2、安装插件 remote-ssh

3、配置ssh环境,我使用的是gitbash的ssh,直接将git-ssh路径加入到环境变量即可
使用ssh命令尝试登录远程服务器
ssh loginname@remoteip
如:ssh [email protected],成功进入linux界面表示OK。
如果出现错误提示,按照提示的行数(如图中的Line_18),删除无效密钥即可,错误提示如下:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:hE4W4xztQR+8EY332KocwkN2R5FaFg3srJz+6holJS9.
Please contact your system administrator.
Add correct host key in /c/Users/hugh/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/hugh/.ssh/known_hosts:18
ECDSA host key for 67.111.16.45 has changed and you have requested strict checking.
Host key verification failed.

在这一步我很傻的安装了openssh,导致ssh有两个
??为什么我会发现有两个呢?
1、我使用which ssh找到当前的ssh路径在D盘,发现并不是git-ssh的;
2、再使用where ssh找到所有的ssh,卸载掉D盘的ssh;
3、将gitssh添加到path,重启命令终端使用ssh登录验证是否OK。

4、配置vscode的config

Host 别名-随便起名
    HostName 远程ip
    User 远程登录用户名

5、大功告成

6、常用配置,https://blog.csdn.net/qq_22038327/article/details/94854257

发布了85 篇原创文章 · 获赞 27 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/qq_22038327/article/details/93724173