【已解决】git clone 报错:Could not read from remote repository. Please make sure you have the correct acce

这篇具有很好参考价值的文章主要介绍了【已解决】git clone 报错:Could not read from remote repository. Please make sure you have the correct acce。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。


一、问题

换电脑了,克隆代码遇到报错:

git clone git@codeup.aliyun.com:qwertyuiopasdfghjkl/projectName.git
Cloning into 'projectName'...
找不到代码库,请确认是否有权限且代码库路径正确
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

找到本地公钥,复制到添加 SSH 公钥处,遇到报错:

该密钥已被添加为用户密钥或部署密钥,添加失败

官方提出的解决办法:添加 SSH Keys 报已存在怎么办?
按照官方的提示,大概率是原因1,只能重新生成了

但是现在本地这个 SSH Key 在其他地方有使用(Gitee/Github/…),想要保留,再生成一个。

二、解决

按照以下两篇官方说明:

  • 如何在同一台电脑上配置多个SSH Key?
  • 配置 SSH 密钥

决定尝试 ED25519 算法生成的密钥(同一算法需要指定不同路径,使用不同算法就免了)

ssh-keygen -t ed25519 -C "<注释内容>"

按照默认路径生成后,配置config文件(~/.ssh/config)

# Codeup (2023.05.18 add)
HostName codeup.aliyun.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_ed25519

当本地存在多个密钥,如果不设置认证规则,本机将随机选择一个密钥用于认证,可能造成认证失败。

接下来复制公钥粘贴到指定位置

# Windows
cat ~/.ssh/id_ed25519.pub | clip

保存后就可以使用啦

三、拓展学习

1.ssh命令

  • 远程登录(查看当前使用的密钥对应的账号)
ssh -t git@codeup.aliyun.com

正常显示:

Welcome to Codeup, userName!
Connection to codeup.aliyun.com closed.

SSH(远程登录)

2.Ed25519:一个高速度高安全的签名方法

  • Ed25519:一个高速度高安全的签名方法
  • 官方介绍:Introduction
  • 它的签名长度为64个字节,公钥长度是32个字节

签名一共经过三个环节

  1. 生成公钥、私钥
  2. 使用私钥签名
  3. 使用公钥验签

over文章来源地址https://www.toymoban.com/news/detail-496482.html

到了这里,关于【已解决】git clone 报错:Could not read from remote repository. Please make sure you have the correct acce的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • git 解决 “fatal: Could not read from remote repository.“

    现象 在使用Git将本地仓库推送到远程仓库的时候,发生了如下错误:“fatal: Could not read from remote repository.”   原因 出现这错误一般是以下两种原因: 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 为解决以上问题,我们需要重新生成一次ssh key ,并重新配置一

    2024年02月09日
    浏览(36)
  • git报错:Permission denied (publickey). fatal: Could not read from remote repository.

    背景 :由于新换了电脑,新装了git,所以在用git拉取代码的时候就出现了标题一样的错误 ternimal下出现下面错误: Permissiondenied (publickey). fatal:Could not read from remote repository. Pleasemake sure you have the correct access rights and the repository exists. 分析原因 : 原因是由于你在本地(或者服务

    2024年02月05日
    浏览(47)
  • Git 报错:Connection closed by remote host. fatal: Could not read from remote repository.

    1、背景: 今天部署到GitHub时,出现此错误。昨天还正常,今天突然这样。 2、详细错误信息: 3、解析错误信息: 错误信息翻译成中文后: 通过以上可知: 系统连接不到GitHub,因此无法用SSH密钥进行识别。 ---- 说明是网络问题。 4、实践探索 - 解决过程: 出现错误的时候,

    2024年02月07日
    浏览(94)
  • [git]报错fatal: ‘origin‘ does not appear to be a git repository Could not read from remote repository

    问题1:   fatal: \\\'origin\\\' does not appear to be a git repository fatal: Could not read from remote repository. 说明库是有的,但是没办法push。所以重新关联一下。 解决方法: 输入以下代码, 这是因为本地的分支没有和远程分支建立联系,需要执行以下代码就可以正常 push 了   问题2:   fatal:

    2024年02月09日
    浏览(43)
  • 解决git@github.com: Permission denied (publickey). Could not read from remote repository

    原因分析 Permission denied (publickey) 没有权限的publickey ,出现这错误一般是以下两种原因 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 找到问题的原因了,解决办法也就有了,重新生成一次ssh key ,服务端也重新配置一次即可。 客户端生成ssh key 470812087@qq.com改为

    2024年02月04日
    浏览(56)
  • 解决git@github.com:Permission denied (publickey).fatal:Could not read from remote repository.

    1.打开Git Bash。 2.输入 ls -al ~/.ssh 以查看是否存在现有 SSH 密钥。 3.检查目录列表以查看您是否已有公共 SSH 密钥。默认情况下,GitHub 支持的公钥的文件名是以下之一: id_rsa.pub、 id_ecdsa.pub、 id_ed25519.pub。 如果您收到 ~/.ssh 不存在的错误,则说明您在默认位置中没有现有的 SS

    2024年02月12日
    浏览(48)
  • 解决GIT问题:git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repository.

    下图是详细的报错信息: 对于这个问题,我们得针对不同的情况来分析,逐步解决这个问题 如果您是刚开始使用git,并且没有生成公钥,我们需要先使用命令来生成公钥 为了更加易懂,给大家额外补充一些SSH的知识 SSH key 的作用: 实现本地仓库和 Github 之间免登录的加密数据

    2024年02月20日
    浏览(46)
  • 解决git@github.com:Permission denied (publickey). Could not read from remote repository. Please make s

    这个错误通常表示没有正确的权限来访问该 Git 仓库。 为了解决GitHub上的权限问题,需要执行以下步骤: 打开命令行终端(例如Git Bash)并输入以下命令: 将公钥添加到GitHub帐户中, 执行以下步骤: 在“Title”字段中为新密钥提供一个描述性标题。 将“Key”字段中的公钥粘

    2024年02月06日
    浏览(42)
  • 解决在linux上git clone 时报错 git@gitee.com: Permission denied (publickey). Could not read from remote repo

    今天在gitee上看到一个比较感兴趣的项目,于是就想下载下来研究研究,结果git clone 克隆的时候报错了,报错如下: git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists. Permission denied (publickey) 没有权

    2024年02月11日
    浏览(46)
  • git问题:git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

    重装系统后,git push项目时出现git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.出现这个问题表示你在尝试将本地代码推送到GitHub时,没有提供正确的公钥,或者你的公钥没有被添加到你的GitHu

    2024年02月21日
    浏览(44)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包