5月 292018
 

问题: 如题。

现场情况:

  1. 我~/.ssh/下有多个秘钥
  2. 配置了 .ssh/config 文件,不同类型的机器使用不同的秘钥,也有一些机器使用默认的秘钥

问题原因:

  1. ssh-copy-id 默认使用的秘钥并不是 id_rsa.pub,而是最新修改过的秘钥:
  2. ssh 命令默认使用的秘钥是 id_rsa.pub
  3. 所以,ssh-copy-id 和 ssh 默认不同的秘钥时,就会出现上述问题
  4. 说明:
    1. ssh-copy-id 时,会提示使用的秘钥是哪个的:
    2. 可以通过 -i 选项来指定ssh-copy-id来使用哪个秘钥:
 Posted by at 上午 10:08

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据