GitLab v6.2.0.pre 666849b - 通过ssh克隆时拒绝访问

时间:2013-10-15 21:40:02

标签: gitlab

更新

这是特定于用户的。当我卷曲网址

http://localhost//api/v3/internal/allowed?key_id=22&action=git-upload-pack&ref=_any&project=analytics/dns-website

来自GitLab服务器使用id 22,响应为“false”。如果我将key_id更改为另一个用户的key_id,则响应为“true”


每当我使用我的LDAP凭据克隆现有的git repo(或从远程推/拉)时,我都会收到错误:

Access denied. fatal: The remote end hung up unexpectedly

其他域中的LDAP用户不受影响。

我删除并重新添加了一个公钥到我的GitLab配置文件,我可以成功测试ssh连接:

#ssh -vT git@git.mysite.com

OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
...
Welcome to GitLab, Keith Harris!
...
debug1: Exit status 0

gitlab-shell.log报告以下错误:

  

W,[2013-10-15T16:55:43.226875#23590]警告 - :gitlab-shell:git命令的访问被拒绝< git-upload-pack' analytics / dns-website.git'>用户使用密钥-22。

1 个答案:

答案 0 :(得分:1)

我正在关闭这个问题并且现在会问另一个问题我明白这个问题与GitLab配置无关。

我发现api调用仅对我域中的用户失败,其他企业域中的用户不受影响。

lib / api / internal.rb第38行返回false,因为Gitlab :: LDAP :: User.blocked?(user.extern_uid)== true

更新

我使用PR#5400 https://github.com/gitlabhq/gitlabhq/pull/5400

开始工作

需要更新lib / gitlab / ldap / user.rb:

def blocked?(dn)
    ldap = OmniAuth::LDAP::Adaptor.new(ldap_conf)
    ldap.connection.search(base: dn, scope: Net::LDAP::SearchScope_BaseObject, size: 1).blank?
end
相关问题