直接在VScode应用商店搜索安装即可:

二. 登陆服务器的root用户
使用命令"su -"或者"sudo -i -u root"都可以。

三.用vim编辑器打开服务器的SSH配置文件,把PasswordAuthentication后面的no改为yes,表示SSH允许远程密码认证
打开SSH配置文件使用命令“vim /etc/ssh/sshd_config”.

修改后按esc键退出编辑模式使用"wq"命令退出,最后还要输入“sudo service ssh restart”重新启动ssh服务:

四. 使用VScode连接
首先点解VScode左侧的SSH插件按钮

再点击SSH的加号新建远程:

然后输入连接命令: ssh root@ip地址:端口号

接下来就是选择操作系统,再输入服务器root用户的登陆密码即可.
若忘记密码可以使用命令"passwd root"修改密码:
