【问题标题】:gitlab -> git push -u origin master ->access denied, fatal: The remote end hung up unexpectedlygitlab -> git push -u origin master ->access denied, fatal: 远程端意外挂断
【发布时间】:2015-03-11 04:47:43
【问题描述】:

我正在使用 gitlab 来管理 git 连接。这是我的问题:

root@ubuntu:/tmp/test1/test1# git push -u origin master
Access denied.
fatal: The remote end hung up unexpectedly

我也查了gitlab-shell.log,内容如下:

W, [2015-01-13T16:47:13.252992 #26662]  WARN -- : gitlab-shell: Access denied for git command <git-receive-pack 'Jianyong/test1.git'> by user with key key-8.

我的主机运行的是 CentOS 6.6,这是我的 gitlab 环境:

System information
System:     CentOS release 6.6 (Final)
Current User:   root
Using RVM:  no
Ruby Version:   2.0.0p353
Gem Version:    2.0.14
Bundler Version:1.7.12
Rake Version:   10.1.0

GitLab information
Version:    6.4.3
Revision:   3173626    
Directory:  /home/git/gitlab 
DB Adapter: mysql2
URL:        http://gitlab.glodon-ci.com
HTTP Clone URL: http://gitlab.glodon-ci.com/some-project.git
SSH Clone URL:  git@gitlab.glodon-ci.com:some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    1.9.6
Repositories:   /home/git/repositories/
Hooks:      /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git

那我也试过了:

ssh -T git@gitlab.glodon-ci.com

它记录了“欢迎来到 Gitlab,管理员!”

怎么了?

【问题讨论】:

  • 你试过git@localhost是什么意思? user with key key-8 是否有权访问 Jianyong/test1.git 存储库?
  • review.gitlab.com 是如何连接到gitlab.glodon-ci.com 的?不,但我想这是一个 gitlab 管理界面任务。
  • 天哪。很抱歉,它是 'ssh -T git@gitlab.glodon-ci.com'。我尝试修改它。

标签: git centos gitlab


【解决方案1】:

几天后,我终于解决了。 注意gitlab的几个方面。就是这样:

  1. 如果你使用了 apache 反向代理,你应该编辑/home/git/gitlab-shell/config.yml
    gitlab_url = "http://youraddress:port"
  2. 如果您使用的是使用 selinux 机制的 centos 或 radhat os,则应将其从强制更改为许可。
  3. 确保您已使用您的用户名和电子邮件将公钥粘贴到 gitlab。
  4. 确保您的 gitlab、gitlab-shell、redis 服务运行良好。如果这些都不能正常工作,您应该阅读日志文件以获取一些有用的信息。
  5. 然后,如果您编辑了一些配置文件,您应该重新启动服务。不要忘记它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-02
    • 1970-01-01
    • 2011-08-07
    • 1970-01-01
    相关资源
    最近更新 更多