[email protected]: Permission denied (publickey).fatal: Could not read from remote repository.

这篇博客记录了作者在尝试将本地新建的opencv_contrib_essential_module仓库推送到GitHub时遇到的权限问题。在过程中,GitHub的主机认证未通过,提示缺少public key。作者通过生成新的RSA密钥对,并将其添加到SSH配置中,最终成功解决了权限问题并成功推送了代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 新创建本地厂库上传到github厂库遇到的小问题

nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ git push -u origin main
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)? yes
Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts.
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.
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ git push -u origin main
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.
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ ssh git@github.com
git@github.com: Permission denied (publickey).
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ ssh-keygen -t rsa -C "你的github注册邮箱"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nvidia/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/nvidia/.ssh/id_rsa.
Your public key has been saved in /home/nvidia/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:7RJR+fOlLwP+xlbbpkRFNMrhsTqc2a0owhZczdR7Vhg 你的github注册邮箱
The key's randomart image is:
+---[RSA 2048]----+
|          .o.oE=o|
|         .= o.*.o|
|        .. + =. o|
|      . .o. B..+.|
|       oS .* +++ |
|      . .o  +.+ .|
|       +...o +.oo|
|      . ... ..*.+|
|             +o= |
+----[SHA256]-----+
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ cat /home/nvidia/.ssh/
id_rsa       id_rsa.pub   known_hosts
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ cat /home/nvidia/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFRJEwmhxYoQ0lmJDrlVUmNvq0GivaPNxsXLJlJ5h+2tJ+G+g8AUvysWea+AjURwgLjJkwX/DFEliW4BIII9MFw/pj8qFc7qxdxZ8Wq6mQmP1aVd09emYzt2h0bxpFpdF2EXpv8w9PpOGksz9SpdVRm/twqm/mIPPqn/V6xKwLRdYPKMHIcpEnDwgM71dBfBAIdjK8FOojIKch5qYEmodXCpv0tkiH/7cmr8e1M0vUtuKC0ADVA6kwdgQ6zckBXk27EL4BC2dOO9GGxTHjJhhMEWynd1Fl09Fv8b+NbW5sH4UsEllr9rz5yDqfzTn+nR3hWOUwfhGEWVVg7e0Lore9 你的github注册邮箱
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ ssh git@github.com
PTY allocation request failed on channel 0
Hi Unlicensed-driver-ljx! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$ git push -u origin main
Counting objects: 3, done.
Writing objects: 100% (3/3), 255 bytes | 255.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To github.com:Unlicensed-driver-ljx/opencv_contrib_essential_module.git
 * [new branch]      main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
nvidia@nvidia-desktop:~/Nano/opencv_contrib_essential_module$

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

无证驾驶梁嗖嗖

让我们解决Jetson使用问题

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值