我有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添加到您已知的主机列表中,以便建立连接 –