Warning:Permanently added ‘git@’ to the list of known hosts permission denied (publickey)

我在使用git時,需要創建ssh,當我輸入

    ssh-keygen -t rsa -C "[email protected]"//生成祕鑰正常
    ssh -T git@git.oschina.net //報錯

提示Warning:Warning:Permanently added ‘git@’ to the list of known hosts permission denied (publickey)錯誤。
解決方案

  • 在當前用戶目錄下創建文件~/.ssh/config,並給文件添加以下內容
UserKnownHostsFile ~/.ssh/known_hosts
  • 將id_rsa.pub的內容添加到碼雲的ssh公鑰(請根據自己的平臺)

參考博客:

1-Warning: Permanently added ‘…’ (RSA) to the list of known hosts –Windows下git bash 警告處理
2-GitHub: Permission denied (publickey). 問題解決方法

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