如下:
suse:~/ecox # git clone git@vcs.in.ww-it.cn:ecox/ecox.git 正克隆到 'ecox'... git@vcs.in.ww-it.cn'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://xxx@vcs.in.ww-it.cn': 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項目,所以在這里記錄一下,方便以后查閱。