推送失败,gitee仓库缺少公钥

git push origin lsk_dev
The authenticity of host 'gitee.com (180.76.198.77)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
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.

检查与自己gitee仓库连接失败,没有显示hellow

ssh -T git@gitee.com
git@gitee.com: Permission denied (publickey).

进行公钥配置

ssh-keygen -t rsa -C "14062626+linsk27@user.noreply.gitee.com"
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\lsk69/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\lsk69/.ssh/id_rsa
Your public key has been saved in C:\Users\lsk69/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:SOV+Ur+E321Pw+9NL77mSgZm6V8lc+W3LJi3rN5qXG8 14062626+linsk27@user.noreply.gitee.com
The key's randomart image is:
+---[RSA 3072]----+
|        .        |
|       o         |
|      . . .     .|
|     . o . +   ..|
|      . S B o o =|
|         * +o+o|
|          oo*o+==|
|           *+.=E*|
|          o+=O=+*|
+----[SHA256]-----+

获取公钥失败

 ssh-agent -s
unable to start ssh-agent service, error :1058

> Fix Error **unable to start ssh-agent service, error: 1058(xxxx)**
>
> 1. win + R, Go To `services.msc`
>
> 2. Find And Check Is `OpenSSH Authentication Agent` Service Running
> 

再次运行公钥获取成功,连接成功

ssh-agent -s

ssh -T git@gitee.com
Hi linsk27(@linsk27)! You've successfully authenticated, but GITEE.COM does not provide shell access.

复制公钥数据到gitee仓库的公钥(设置)

把ssh密钥添加到码云

打开C盘–>用户–>你的用户名–>找到.ssh文件夹。找到id_rsa.pub(日过有多个用最新的那个),用记事本打开,复制整个文本粘贴到gitee(点头像,进入gitee设置面板,SSH设置,将复制的文本粘贴到公钥,标题会自动生成,然后点击添加,根据提示输入密码就可以了。)

重新推送成功

git push origin lsk_dev
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 16 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (16/16), 2.19 KiB | 2.19 MiB/s, done.
Total 16 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Powered by GITEE.COM [1.1.5]
remote: Set trace flag 824c4db5
remote: Create a pull request for 'lsk_dev' on Gitee by visiting:
remote: https://gitee.com/larrry/competition-system/pull/new/larrry:lsk_dev...larrry:main
To gitee.com:larrry/competition-system.git
 * [new branch]      lsk_dev -> lsk_dev
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐