微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vscode remote ssh 免密码步骤

1. 生成公钥

ssh-genkey 在window 端git-bash中执行,如果没有安装git就安装一个widNow git

2. 将公钥添加到linux server 端

  • 方式1 : 直接复制

    scp -P 22 id_rsa-remote-ssh.pub [email protected]:~/.ssh/

  • 方式2 : 工具命令复制

    ssh-copy-id -i .ssh/id_rsa.pub 用户名字@192.168.x.xxx
    添加完成 。
    `
    $ ssh-copy-id -i .ssh/id_rsa.pub [email protected]
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted Now it is to install the new keys
    [email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
`

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐