2015-01-13 43 views
0

我正在使用gitlab来管理git连接。这里是我的问题:gitlab - > git push -u原点大师 - >访问被拒绝,致命:远程端意外挂断

[email protected]:/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: [email protected]: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 [email protected] 

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

有什么不对?

+0

你是什么意思你试过'git @ localhost'?具有key-key的用户是否拥有对'Jianyong/test1.git'版本库的访问权限? –

+0

'review.gitlab.com'如何连接到'gitlab.glodon-ci.com'?不,但我会想象这是一个gitlab管理界面任务。 –

+0

我的天。我很抱歉,这是'ssh -T [email protected]'。我尝试修改它。 –

回答

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. 然后,如果你编辑了一些配置文件,你应该重新启动服务。别忘记了。
相关问题