部署服务器过程中想clone自己github中的库,结果出现Permission denied (publickey).的错误,解决方法是添加服务器公钥到github的settings->SSH and GPG keys->new ssh key中。

  获取服务器公钥的方式是

ssh-keygen -t rsa

  之后一路回车,公钥和私钥都会存在默认的~/root/.ssh/目录中。

  进入这个目录,用  cat id_rsa.pub  查看公钥,然后将显示的内容复制到new ssh key中即可

相关文章:

  • 2021-04-01
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2021-04-02
  • 2021-05-28
  • 2021-08-24
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案