VScode Remote SSH插件用密钥登录

remote SSH在第一次启动时会让用户选择配置文件的存储位置,这里我选择了默认位置:C:\Uses\yourUsername\.ssh\config
当我们想使用SSH私钥登录服务器时,只需在上述文件里添加一条:IdentityFile /path/to/yourPrivateKey
而该私钥可自己生成或复用其他工具生成的,最后config文件内容如下:

Host name-of-ssh-host-here
    User your-user-name-on-host
    HostName host-fqdn-or-ip-goes-here
    IdentityFile ~/.ssh/id_rsa-remote-ssh

关联官方文档:
https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章