fatal: unable to access 'https://github.com/samtools/htslib/': GnuTLS recv error (-54): Error in the pull function.

 

001、问题

root@ubuntu01:/home/software# git clone https://github.com/samtools/htslib
Cloning into 'htslib'...
fatal: unable to access 'https://github.com/samtools/htslib/': GnuTLS recv error (-54): Error in the pull function.

 

 

 

002、解决方法, 构建ssh密钥(使用ssh下载链接)

a\

root@ubuntu01:/home/software# git config --list              ## 获取当前git的配置文件的内容(文件在:~/.gitconfig)       
https.sslverify=true

 

 

 

b\ 设置git的user name和email

root@ubuntu01:/home/software# git config --global user.name "liujiaxin"
root@ubuntu01:/home/software# git config --global user.email "jiaxinliu2019@126.com"

 

 

 

c\再次查看git的配置文件

root@ubuntu01:/home/software# git config --list
https.sslverify=true
user.name=liujiaxin
user.email=jiaxinliu2019@126.com

 

 

 

d\生成SSH Key

root@ubuntu01:~# ssh-keygen -t rsa -C "jiaxinliu2019@126.com"      ## 生成ssh key(一直回车即可)

 

 

e、获取ssh key

root@ubuntu01:~# cd ~/.ssh/         ## 进入该目录
root@ubuntu01:~/.ssh# ls         ## 复制id_rsa.pub 文件的内容
id_rsa id_rsa.pub

 

f、进入github网页,点击用户, 然后点击设置

 

 

 

g、点击ssh和gpgkeys

 

 

 

h、点击new sshkey

 

 

 

i、随便命名一个标题,输入复制的ssh key,最后点击 add ssh key

 

 

 

j、 输入密码确认

 

 

 

k、添加成功

 

 

l、测试是否成功配置SSH Key

root@ubuntu01:~/.ssh# ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.113)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Hi liujiaxin7! You've successfully authenticated, but GitHub does not provide shell access.

 

 

m\ 利用ssh链接下载测试

 

 

n、

root@ubuntu01:/home/software# git clone git@github.com:samtools/htslib.git   ##  没有问题

 

 

参考:

001、https://blog.csdn.net/weixin_44031582/article/details/122604217

002、https://blog.csdn.net/u013778905/article/details/83501204

 

posted @ 2022-09-16 22:51  小鲨鱼2018  阅读(982)  评论(0编辑  收藏  举报