1. 程式人生 > >git clone 提示輸入git@xxx的密碼

git clone 提示輸入git@xxx的密碼

remote id_rsa ... oca pro 影響 fig 系統 ati

如下:

suse:~/ecox # git clone [email protected]:ecox/ecox.git
正克隆到 ‘ecox‘...
[email protected]‘s password:

但是我都不知道密碼是啥,跟登錄git庫的密碼不一樣。

然後使用http的方式,報一個錯誤:

use:~/ecox # git clone https://vcs.in.ww-it.cn/ecox/ecox.git
正克隆到 ‘ecox‘...
fatal: unable to access ‘https://vcs.in.ww-it.cn/ecox/ecox.git/‘: SSL certificate problem: unable to get local issuer certificate

提示SSL證書錯誤。發現說這個錯誤並不重要是系統證書的問題,系統判斷到這個行為會造成不良影響,所以進行了阻止,只要設置跳過SSL證書驗證就可以了,那麽用命令 :

 git config --global http.sslVerify false

然後可以了,但是還是會要用戶名和密碼:

suse:~/ecox # git clone https://vcs.in.ww-it.cn/ecox/ecox.git
正克隆到 ‘ecox‘...
Username for ‘https://vcs.in.ww-it.cn‘: xxx
Password for ‘https://[email protected]‘:
remote: HTTP Basic: Access denied
fatal: Authentication failed for ‘https://vcs.in.ww-it.cn/ecox/ecox.git/‘

回到了老問題,於是想到設置git賬戶的密碼,改一下試試?

在準備改密碼的過程中,發現用戶下面可以配置ssh-key,於是嘗試配一下ssh-key來讓ssh信任:

use:~/ecox # ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):

最後果然不需要再輸入密碼了,成功clone項目,所以在這裏記錄一下,方便以後查閱。

git clone 提示輸入git@xxx的密碼