vscode安装remote-SSH
生成🔑
cmd打开输入ssh-keygen -t rsa -b 4096
连接到服务器
写一下config
在C://User/用户名/.ssh/config文件
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host yuechan
HostName (此处写ip地址)
User root
IdentityFile "C:\Users\(此处是用户名)\.ssh\id_rsa"
# host是我自己设的服务器名字
# hostname是服务器ip地址
# 用户名使用的root比较方便
# identityfile是私钥文件id_rsa
如果连接过其他服务器导致连接不上
删掉known_host文件重试