当前位置:   article > 正文

git clone 提示输入git@xxx的密码

git clone git@

如下:

  1. suse:~/ecox # git clone git@vcs.in.ww-it.cn:ecox/ecox.git
  2. 正克隆到 'ecox'...
  3. git@vcs.in.ww-it.cn's password:

 但是我都不知道密码是啥,跟登录git库的密码不一样。

 

然后使用http的方式,报一个错误:

  1. use:~/ecox # git clone https://vcs.in.ww-it.cn/ecox/ecox.git
  2. 正克隆到 'ecox'...
  3. 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

 

然后可以了,但是还是会要用户名和密码:

  1. suse:~/ecox # git clone https://vcs.in.ww-it.cn/ecox/ecox.git
  2. 正克隆到 'ecox'...
  3. Username for 'https://vcs.in.ww-it.cn': xxx
  4. Password for 'https://xxx@vcs.in.ww-it.cn':
  5. remote: HTTP Basic: Access denied
  6. fatal: Authentication failed for 'https://vcs.in.ww-it.cn/ecox/ecox.git/'

 

回到了老问题,于是想到设置git账户的密码,改一下试试?

在准备改密码的过程中,发现用户下面可以配置ssh-key,于是尝试配一下ssh-key来让ssh信任:

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

 

最后果然不需要再输入密码了,成功clone项目,所以在这里记录一下,方便以后查阅。

 

转载于:https://www.cnblogs.com/kuang17/p/9676065.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/758288
推荐阅读
相关标签
  

闽ICP备14008679号