VScode连接服务器不用每次都输入密码

VScode连接服务器不用每次都输入密码.

  1. 用git或xcode的ssh keygen生成一组不带密码的 rsa2048 的公钥id_rsa_nopasswd.pub和私钥id_rsa_nopasswd
  2. 公钥上传到远程机器的.ssh文件夹中
    1. cat id_rsa_nopasswd.pub >> authorized_keys
  1. 私钥留在本地的.ssh文件夹中, 比如: C:\Users\Administrator\.ssh中的 id_rsa_nopasswd
  2. 在vscode的remote的host选项中, 加入IdentityFile这一项, 位置就是你的私钥.  
  3. 以后就不需要输入密码就能远程了.
posted @ 2024-06-03 08:31  酱_油  阅读(54)  评论(0编辑  收藏  举报