GitLab需要git @ localhost密码才能推送回购 [英] GitLab requires git@localhost password to push to a repo

查看:137
本文介绍了GitLab需要git @ localhost密码才能推送回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让GitLab在我的服务器上运行。我遵循gitlab github页面上的安装说明,一切进展顺利。



问题在于,当我创建一个回购站点并尝试

  sudo git push -u原点大师

我被提示输入'git @ localhost的密码:'

git用户没有密码,所以这是一个问题。



遇到这个问题的其他人建议将git添加到我的sshd conf中的AllowedUsers中,但是我没有AllowedUsers字段,所以这似乎不成问题。 / p>

我对ssh的东西还很陌生,所以我相信它的某种ssh密钥问题,尽管我试图将所有相关的ssh密钥添加到/ home / git /中。 ssh / authorized_keys,并验证文件中没有换行符。



仅供参考,我的安装完全通过了gitlab wiki中提供的测试:

  sudo -u gitlab bundle exec rake gitlab:app:status RAILS_EN V =生产

任何建议都非常感谢!



编辑



因此,我终于通过承诺从另一台机器进行回购来解决此问题。事实上,我被SSH登录到gitlab运行的同一台机器上。只要我尝试从主机以外的机器提交,它就很好。所以,这可能是一些人的解决方案(这对我们来说是,因为我们是在独立的机器上开发而不是我们的服务器)。

对于那些试图在同一台机器上主持并开发的人来说,这仍然是一个开放式问题。

解决方案

TL; DR

Keys在gitlab DB和gitolite端存储。
你应该使用工厂编译的gitolite-admin.git文件夹,不要使用你的备份!
然后用update keys命令重建gitolite的Keys。
(将那些已经保存在gitlab db中的密钥更新到gitolite)

$ $ $ $ $ $ sudo -u gitlab -H bundle exec rake gitlab:gitolite:update_keys RAILS_ENV =制作






这是因为没有正确保存gitolite密钥有问题。
这些键(用于登录)实际上由gitlab& amp; amp; gitolite。
对于拉/推实际上是使用保存在gitolite中的密钥。
(git / repositories / gitolite-admin.git / index,git / .gitolite / keydir,git / .ssh / authorized_keys)

gitlab通常会帮助在网上将这些导入的密钥保存到gitolite文件中。
但是,由于某些原因,它失败了。
由于密钥没有在gitolite中正确保存,客户/服务器无法使用密钥并回退到密码。



您必须检查并修复这些密钥钥匙保存在gitolite中以解决问题。



请查看更多
https://groups.google.com/forum/?fromgroups=#!topic/gitlabhq/X0z_9l7L7A8


I'm trying to get GitLab up and running on my server. I followed the installation instructions at the gitlab github page and everything went well.

The issue is, when I create a repo and try to

sudo git push -u origin master

I am prompted for 'git@localhost's password: '

The git user doesn't have a password, so this is a problem.

Other people who have run into this problem suggested adding git to AllowedUsers in my sshd conf but I don't have an AllowedUsers field in there, so that doesn't seem to be an issue.

I'm still pretty new to ssh stuff so I believe its some sort of ssh key issue, though I tried to add all relevant ssh keys to /home/git/.ssh/authorized_keys and verified that there are no line breaks in the file.

Just FYI, my install completely passes the test provided in the gitlab wiki:

sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production

Any suggestions much appreciated!

EDIT

So, I finally got around this by just committing to a repo from a different machine. As it was, I was SSHed into the same machine that gitlab was running on. As soon as I tried to commit from a machine other than the host, it worked great. So, that may be a solution for some people (it is for us, since we develop on seperate machines than our servers).

This is still an open-ended issue for anyone trying to host and develop on the same machine who has run into this.

解决方案


TL;DR

Keys store on both gitlab DB and gitolite side. You should use the factory build gitolite-admin.git folder, don't use your backup! And rebuild the Keys for gitolite later with the update keys command. (update those keys already saved inside the gitlab db to gitolite)

sudo -u gitlab -H bundle exec rake gitlab:gitolite:update_keys RAILS_ENV=production


Most likely it's because there is something issue about the gitolite keys not save properly. Those keys (for login) are actually keep separately by gitlab & gitolite. For pull/push is actually using the keys saved inside gitolite. (git/repositories/gitolite-admin.git/index, git/.gitolite/keydir, git/.ssh/authorized_keys)

gitlab normally should help on saving those imported keys on web to the gitolite files. However, for some reasons it failed. As the keys are not saved properly inside gitolite, the client/server fail to use the keys and fallback to password.

You have to check and fix those keys saved inside gitolite to correct the problems.

check out for more https://groups.google.com/forum/?fromgroups=#!topic/gitlabhq/X0z_9l7L7A8

这篇关于GitLab需要git @ localhost密码才能推送回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆