配置vscode远程免密登入Linux服务器_vscode 远程linux 免密 知乎-CSDN博客
1、本地、服务器生成私钥:ssh-keygen -t rsa -p 4096, ssh-keygen -t rsa -p 4096
不断Enter,生成 /.ssh文件夹 及 私钥文件id_ras 和 公钥文件id_rsa.pub
2、在.ssh/config文件中加入 IdentityFile "C:\Users\User_name/.ssh/id_rsa"
3、用本地生成的公钥,上传到服务器中,取代服务器 /.ssh 中的公钥.pub文件
4、服务器 cd ./ssh,
生成授权文件 touch authorized_keys
写入公钥信息cat id_rsa.pub >> authorized_keys
修改权限 chmod 700 ~/.ssh/ chmod 600 ~/.ssh/authorized_keys
收兵。