把linux上的ssh密码登录功能打开
否则可能会出现报错:
Permission denied (publickey).
打开linux ssh服务,打开配置文件
wc@r740:~$ sudo vim /etc/ssh/sshd_config
#PasswordAuthentication no #change the upper into: PasswordAuthentication yes
修改后需要重启服务
wc@r740:~$ sudo service sshd restart二、配置本地 1. VSCode商店里面安装Remote SSH
这里我下载的是v0.78.0,安装最新版本就行
2. 配置文件 C:Usersuser .sshconfigHost 219.223.251.67 HostName 219.223.251.67 User wc PasswordAuthentication yes StrictHostKeyChecking no3. 配置文件 Remote SSH 的settings.json
这里特别强调,一定要配置好remote.SSH.configFile,记得写绝对路径,不然会报错
"remote.SSH.showLoginTerminal": true,
"remote.SSH.configFile": "C:\Users\LEVI\.ssh\config",
"remote.SSH.useLocalServer": false,
"remote.SSH.remotePlatform": {
"219.223.251.67": "linux"
},
注意这里的219.223.251.67是我的HostName,linux是我的ssh服务端(远程端)的操作系统类型。
备注如果出现"过程试图写入的管道不存在。"的错误,记得一定看一下报错信息,比如下面这个就是config里面有内容写错了
[21:42:56.035] > C:\Users\LEVI\.ssh\config: line 2: Bad configuration option: ubuntu连接成功
成功连接后会需要你输入密码
蔚天灿雨的Debug 实录 2022/04/26 HITSZ LEVI


