Github git clone error: Peer's Certificate has expired

今天用github 克隆Tensorflow公共代码库,报 ‘Peer’s Certificate has expired’ 错误

[cos@localhost github]$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
Cloning into 'tensorflow'...
fatal: unable to access 'https://github.com/tensorflow/tensorflow/': Peer's Certificate has expired.

因为很久没有使用Github了, 也不知道哪里有问题。开始想设置成SSH,后来发现可能是虚拟机时间没有同步,于是安装ntp同步时间,我的系统是centos7:

[cos@localhost github]$ date
Wed Aug 26 04:07:42 EDT 2015
[cos@localhost scripts]$ sudo yum -y install ntp 
[cos@localhost scripts]$ sudo chkconfig ntpd on
Note: Forwarding request to 'systemctl enable ntpd.service'.
ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
[cos@localhost scripts]$ sudo ntpdate time.apple.com
12 May 07:52:16 ntpdate[28563]: step time server 17.253.84.253 offset 22477005.642802 sec                                           

然后再运行克隆命令就可以了:

[cos@localhost github]$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
Cloning into 'tensorflow'...
remote: Counting objects: 42594, done.
Receiving objects:   2% (1000/42594), 260.01 KiB

其实github也可以配置成通过SSH访问,我最近一直用的bitbucket就是配置成SSH协议。首先生成Key:

[cos@localhost nlp]$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cos/.ssh/id_rsa):
Created directory '/home/cos/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cos/.ssh/id_rsa.
Your public key has been saved in /home/cos/.ssh/id_rsa.pub.
The key fingerprint is:
...
cos@localhost.localdomain
The key's randomart image is:
...

然后要在github网站账户设置里添加公共密匙,就是刚生成的 ~/.ssh/id_rsa.pub文件内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值