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

vscode remote ssh 免密码步骤

1. 生成公钥

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

  • 输入命令后,提示需要内容,全部不管,回车即可。后面会提示你密码的:

2. 将公钥添加到linux server 端

  • 方式1 : 直接复制

    scp -P 22 id_rsa-remote-ssh.pub phoenix@192.168.81.128:~/.ssh/

  • 方式2 : 工具命令复制

    ssh-copy-id -i .ssh/id_rsa.pub 用户名字@192.168.x.xxx
    添加完成 。
    `
    $ ssh-copy-id -i .ssh/id_rsa.pub ll@192.168.3.2
    /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
    lin@192.168.3.2's password:

Number of key(s) added: 1

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

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

相关推荐