[u r the butter of my bread, the breath to my life -- Julie & Julia]
某些情况下,原来的ssh连接会失效,比如误删了~/.ssh下面的东西。这时,需要重新生成key并加入gitlab或github中。
终端下运行:
ssh-keygen -t rsa -C "your@email"
cat ~/.ssh/id_rsa.pub
然后将newkey加入gitlab/github中即可。
有时,虽然采取了上面的方法,还会出现如下报错:Agent admitted failure to sign using the key.
解决方法如下:
ssh-add ~/.ssh/id_rsa使用 ssh-add 指令將私鑰 加進來 (根据个人的密匙命名不同更改 id_rsa)