gpt4 book ai didi

git - bitbucket.org : Permission denied (publickey)

转载 作者:行者123 更新时间:2023-12-05 06:22:56 30 4
gpt4 key购买 nike

我要表演来自 bitbucket.org 的 git 克隆

git clone git@bitbucket.org:mascai/regru_junjob.git

收到错误:

Cloning into 'regru_junjob'... Warning: Permanently added the RSA host key for IP address '2406:da00:ff00::34cc:ea4a' to the list of known hosts.

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

我将公钥和私钥添加到我的服务器:

~/.ssh# ls
authorized_keys id_rsa.pub known_hosts reg_jj reg_jj.pub

将公钥添加到 bitbucket.org https://bitbucket.org/mascai/regru_junjob/admin/access-keys/

错误原因是什么?

可能有用

~# ls -la ~/.ssh/
total 28
drwx------ 2 root root 4096 ноя 13 15:26 .
drwx------ 4 root root 4096 ноя 13 15:26 ..
-rw------- 1 root root 782 ноя 13 14:26 authorized_keys
-rw-r--r-- 1 root root 381 ноя 13 15:25 id_rsa.pub
-rw-r--r-- 1 root root 3978 ноя 13 15:35 known_hosts
-rw-r--r-- 1 root root 1679 ноя 13 15:26 reg_jj
-rw-r--r-- 1 root root 391 ноя 13 14:54 reg_jj.pub

最佳答案

使用@phd 建议的命令 ssh -Tv git@bitbucket.org,我能够找出问题所在。确实是权限问题

Permissions 0664 for '/home/ubuntu/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

关于git - bitbucket.org : Permission denied (publickey),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58837527/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com