我已阅读:BitBucket: Host key verification failed和Jenkins Host key verification failed以及其他提供的链接。我似乎发现自己处在一种奇怪的情况中。
我想将我的Django回购克隆到一个数字海洋小滴中。我正在遵循本文档的步骤。 https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04。
一切似乎进展顺利,直到需要创建django项目的步骤为止。我已经有一个django项目,因此不想在服务器上创建一个新项目。我只需要将其克隆到服务器上即可。
我跑了:root@ubuntu-s-1vcpu-2gb-xxx:~#rsync --archive --chown=llewellyn:llewellyn ~/.ssh /home/llewellyn
我的bitbucket已上传了id_rsa SSH密钥,并且过去都可以使用,没有生成新的SSH。回购设置为公开。
运行时:
(myprojectenv) llewellyn@ubuntu-s-1vcpu-2gb-xxx:~/myprojectdir$ git clone git@bitbucket.org:LlewellynHattinghLH/repo.git
Cloning into 'repo'...
Warning: Permanently added the RSA host key for IP address '18.205.xx.x' to the list of known hosts.
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我尝试了几篇文章,但大多数只告诉我如何创建新的SSH。
任何帮助将不胜感激。
答案 0 :(得分:0)
首先,您可以这样做:
export GIT_SSH_COMMAND='ssh -Tv'
然后git clone
会更详细,为您提供更多有关失败原因的线索。
第二,关于权限:
您的~/.ssh
必须为700,然后键入600:用ls -alrth ~/.ssh
进行确认。
注意:应该上传到您的BitBucket的是id_rsa.pub
公钥,而不是id_rsa私钥。