git clone git@github.com:ros-perception/robot_vision.git 正克隆到 'robot_vision'... The authenticity of host 'github.com (20.205.243.166)' can't be established. ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM. Are you sure you want to continue connecting (yes/no/[fingerprint])? y Please type 'yes', 'no' or the fingerprint: yes Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: 无法读取远程仓库。 请确认您有正确的访问权限并且仓库存在。
时间: 2024-02-16 07:00:55 浏览: 42
这个错误提示是在使用SSH协议克隆robot_vision软件包时遇到了SSH密钥验证的问题。这可能是由于您没有将SSH密钥添加到GitHub上,或者您的SSH密钥与GitHub不匹配。
您可以尝试以下解决方法:
1. 检查SSH密钥:您需要将SSH密钥添加到GitHub上,以便可以使用SSH协议与GitHub通信。您可以按照以下步骤检查您的SSH密钥是否已添加到GitHub上:
- 打开终端,输入以下命令:
```
cat ~/.ssh/id_rsa.pub
```
- 将输出的公钥复制到GitHub的SSH密钥页面上。
2. 配置SSH访问:如果您的SSH密钥已添加到GitHub上,可以尝试配置SSH访问。请确保您的SSH配置文件(~/.ssh/config)中包含以下内容:
```
Host github.com
Hostname ssh.github.com
Port 443
```
3. 更改克隆协议:如果您无法解决SSH密钥验证的问题,可以尝试更改克隆协议为HTTPS协议。
```
git clone https://github.com/ros-perception/robot_vision.git
```
如果以上方法仍然无法解决问题,您可以尝试重新生成SSH密钥,或者联系GitHub支持寻求帮助。
相关问题
git clone https://github.com/ros-perception/robot_vision.git 正克隆到 'robot_vision'... fatal: 无法访问 'https://github.com/ros-perception/robot_vision.git/':GnuTLS recv error (-110): The TLS connection was non-properly terminated.
这个错误提示是在从GitHub上克隆robot_vision软件包时失败了。这可能是由于网络连接问题引起的。您可以尝试以下解决方法:
1. 检查网络连接:确保您的网络连接正常,可以尝试使用ping命令测试GitHub是否可用。
2. 更换克隆协议:尝试使用SSH协议克隆软件包,而不是HTTPS协议。
```
git clone git@github.com:ros-perception/robot_vision.git
```
3. 使用代理:如果您的网络使用了代理,可以配置Git使用代理。
```
git config --global http.proxy http://your_proxy:port
```
如果以上方法仍然无法解决问题,您可以尝试等待一段时间,稍后再尝试克隆软件包。
$ git remote add origin git@gitee.com:zhang-peihan/git_test.git fatal: not a git repository (or any of the parent directories): .git
根据提供的引用内容,你遇到了两个问题。第一个问题是关于gitee出现报错,错误信息为"git@gitee.com: Permission denied (public... fatal: Could not read from remote repository"。第二个问题是关于使用git remote add origin命令时出现的错误信息"fatal: not a git repository (or any of the parent directories): .git"。下面是对这两个问题的回答:
1. 关于gitee出现报错的问题,错误信息"git@gitee.com: Permission denied (public... fatal: Could not read from remote repository"通常是由于SSH密钥配置不正确或者没有正确设置访问权限导致的。解决这个问题的步骤如下:
- 确保你已经生成了SSH密钥对,并将公钥添加到你的gitee账户中。你可以使用以下命令生成SSH密钥对:
```shell
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```
- 将生成的公钥(默认为~/.ssh/id_rsa.pub)添加到你的gitee账户中。你可以在gitee的设置页面中找到SSH公钥的选项。
- 确保你正在使用正确的SSH URL来克隆或推送代码。你可以在gitee上找到正确的SSH URL,它应该类似于"git@gitee.com:username/repository.git"。
- 如果你已经正确配置了SSH密钥并且仍然遇到问题,可能是由于访问权限不正确。你可以尝试使用以下命令更改文件和目录的权限:
```shell
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
```
2. 关于使用git remote add origin命令时出现的错误信息"fatal: not a git repository (or any of the parent directories): .git"。这个错误通常是因为你在执行该命令时不在一个git仓库目录中。确保你在正确的目录下执行该命令,即包含.git文件夹的目录。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://csdnimg.cn/download_wenku/file_type_lunwen.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)