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

如下:

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项目,所以在这里记录一下,方便以后查阅。

 

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值