0%

SSH连接远程服务器与VSCode-remote环境配置

命令行登录

参考Vlab官方文档 下载私钥 保存到~/.ssh

ssh -i vlab-vm3242.pem root@vlab.ustc.edu.cn连接远程服务器

ctrl + D断开连接

hk2K5nEoRWqGQj1

VScode-remote环境配置

在VSCode-Extension里下载Remote - SSH

TIXoxrmqyWP64gD

点击左下角按钮

image-20220315184229270

选择Connect to Host -> ~/.ssh/config

更改配置文件如下:

1
2
3
4
5
6
7
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host vlab.ustc.edu.cn
HostName vlab.ustc.edu.cn
IdentityFile ~/.ssh/vlab-vm3242.pem
User root

PubkeyAcceptedKeyTypes +ssh-rsa