我有GitHub帳戶,我想推入本地存儲庫。我的密鑰存儲在〜/ .ssh/id_rsa_github路徑中。路徑〜/ .ssh/id_rsa已被用於其他目的。如何同步GitHub的rsa_key?
我通過:ssh-keygen生成密鑰,然後將其保存在〜/ .ssh/id_rsa_github路徑中,然後將其放在GitHub的SSH密鑰選項卡中。
當我這樣做:「混帳推-u起源大師,」我得到的錯誤:
The authenticity of host 'github.com (192.30.253.112)' can't be established. RSA key fingerprint is SHA256:****. Are you sure you want to continue connecting (yes/no)? Host key verification failed. fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
我也試着鍵入:ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
,然後git push -u origin master
並獲得:
警告:永久添加已知主機列表中的IP地址「192.30.253.112」的RSA主機密鑰。 權限被拒絕(公鑰)。 致命:無法從遠程存儲庫讀取。
請確保您擁有正確的訪問權限 並存在存儲庫。
你能幫我嗎?
嘗試' ssh-keyscan -t rsa github.com >>〜/ .ssh/known_hosts' –
但我想將github指向/.ssh/id_rsa_github – CrazySynthax
'id_rsa_github'和'known_hosts'文件有不同的用途。您需要將github添加到您已知的主機列表中,以便建立連接 –