git pull每次都需要输入密码

2019-12-07  本文已影响0人  蜗牛Michael
~/softarclee/workprojects/TvReminder$ git pull
Enter passphrase for key '/Users/michael/.ssh/id_rsa': 

根本原因是:在生成密钥对的时候,你设置了访问SSH需要用密码。因此每次需要读取SSH Key时就要求你提供读取本地SSH Key所需密码以提供git pull对它的访问权限。

办法就是在生成密钥对的时候,不要输入密码,直接回车

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/michael/.ssh/id_rsa):
/Users/michael/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): // 此处不要输入密码,直接回车
Enter same passphrase again: // 直接回车
Your identification has been saved in /Users/michael/.ssh/id_rsa.
Your public key has been saved in /Users/michael/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:OjBF6p+zzmAN3sdOCFoa6RNpBdebeKcCxAoe5Yskryk softarclee@gmail.com
The key's randomart image is:
+---[RSA 4096]----+
| .o....          |
|..+o o.          |
|++..o..o         |
|+oo=o.+ .        |
| .BoB. oS        |
| = B.O.=         |
|E = +.X +        |
|.  o o B         |
|     .+ .        |
+----[SHA256]-----+

然后将新生成的SSH pub key添加到git仓库设置中去。

🦋 michael ☯︎ : ~/softarclee/workprojects/TvReminder$ git pull
已经是最新的。
上一篇下一篇

猜你喜欢

热点阅读