今天用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文件内容