首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Git需要一个密码,即使它的设置带有密钥身份验证。

Git需要一个密码,即使它的设置带有密钥身份验证。
EN

Stack Overflow用户
提问于 2016-10-05 11:28:47
回答 2查看 530关注 0票数 1

我在使用git上有个问题。当我试图访问存储库时,git将自动提示输入密码,即使在gitserver上禁用了auth to。

我的ssh配置如下(主机名/存储库匿名):

代码语言:javascript
复制
host gitserver
  user gitolite
  hostname server.example.com
  identityfile ~/.ssh/gitolite

但是,当我试图克隆回购时,由于密码请求,它失败了:

代码语言:javascript
复制
git clone gitolite@server.example.com:repository
Cloning into 'repository'...
gitolite@server.example.com's password: 

~/..ssh文件夹及其内容是按照描述的here (我尝试过的许多事情之一)使用权限700设置的。

有人找到解决办法了吗?

编辑:

其他克隆的尝试也以同样的方式失败。

代码语言:javascript
复制
git clone gitserver:repository
Cloning into 'repository'...
gitolite@server.example.com's password: 

Edit2:

代码语言:javascript
复制
ssh -Tv gitserver

下列产出的结果:

代码语言:javascript
复制
debug1: Reading configuration data /home/username/.ssh/config
debug1: /home/username/.ssh/config line 1: Applying options for gitserver
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to server.example.com [1.2.3.4] port 22.
debug1: Connection established.
debug1: identity file /home/username/.ssh/gitolite type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/username/.ssh/gitolite-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4
debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 00:df:a5:58:af:45:be:eb:62:65:07:5d:85:20:7c:98
debug1: Host 'server.example.com' is known and matches the RSA host key.
debug1: Found key in /home/username/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/username/.ssh/gitolite
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /home/username/.ssh/gitolite
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
gitolite@server.example.com's password:
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-11-18 09:52:51

找出密码提示的原因。

显然,在git中增加受支持的文件大小的gitolite早期命令之一无法运行,这导致了对gitolite的关键更新被卡在队列中。

因此,~/.ssh/known_hosts从没有在服务器端被海泡石更新,导致密钥的下降.

票数 1
EN

Stack Overflow用户

发布于 2016-10-05 11:49:14

如果您想使用珍珠岩使用的私钥,ssh url必须是:

代码语言:javascript
复制
git clone gitserver:repository

它将使用~/.ssh/gitolite私钥,将您标识为git服务器上的git。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39872764

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档