报错信息
报错日志:
[root@localhost apisix]# git clone git@git.snowballfinance.com:infra/apisix.git
正克隆到 'apisix'...
git@git.snowballfinance.com's password:
Permission denied, please try again.
git@git.snowballfinance.com's password:
[root@localhost apisix]#
解决方法
按我如下的操作即可
[root@localhost apisix]# git --version
git version 1.8.3.1
[root@localhost apisix]# git config --global user.name "name"
[root@localhost apisix]# git config --global user.email "name@mail.com"
[root@localhost apisix]# ssh-keygen -t rsa -C "name@mail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ANo8TIeMuSpERQoaacTXN8h7GcstHnN3rJkLUJ5GW6E yangyue_intern@xueqiu.com
The key's randomart image is:
+---[RSA 2048]----+
|=oo*=.o .. |
|+=+Bo* + o.. |
|+.o.= = XE+ . |
| .. o @ B . o |
|.. o S . = |
|o . . + |
|. . . |
| . |
| |
+----[SHA256]-----+
# 默认会将ssh key生成到下面的这个目录中,按下面的操作即可
[root@localhost ~]# cd /root/.ssh
[root@localhost .ssh]# ls
id_rsa id_rsa.pub known_hosts
[root@localhost .ssh]# cat id_rsa.pub
# 这里会出现字符内容
[root@localhost .ssh]#
将cat出来的字符内容放入自己的ssh里面,如下图,在右边填入自己的key即可
[root@localhost apisix]# git clone git@git.snowballfinance.com:infra/apisix.git
正克隆到 'apisix'...
remote: Enumerating objects: 23807, done.
remote: Counting objects: 100% (23807/23807), done.
remote: Compressing objects: 100% (5265/5265), done.
remote: Total 23807 (delta 17624), reused 23763 (delta 17595), pack-reused 0
接收对象中: 100% (23807/23807), 23.19 MiB | 2.27 MiB/s, done.
处理 delta 中: 100% (17624/17624), done.
[root@localhost apisix]# ls
apisix apisix.zip