簡體   English   中英

GitLab SSH請求密碼並忽略SSH密鑰

[英]GitLab SSH requests password and ignoring SSH Keys

我在CentOS 6機器上安裝了全新的gitlab-omnibus,我已經正確配置了它並且可以訪問Web界面,我添加了SSH密鑰,但是當我嘗試Git克隆新設置的存儲庫時,我被要求通過SSH為Git用戶設置的密碼。 我已經用三種不同的機器和三種不同的帳戶嘗試了此操作,但問題仍然存在。

這是詳細SSH的輸出

╭─jacobclark@Jacobs-MacBook-Pro  ~  
╰─$ ssh -vT git@gitlab                                                                                                                                                                     130 ↵
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to gitlab [37.26.93.221] port 22.
debug1: Connection established.
debug1: identity file /Users/jacobclark/.ssh/id_rsa type 1
debug1: identity file /Users/jacobclark/.ssh/id_rsa-cert type -1
debug1: identity file /Users/jacobclark/.ssh/id_dsa type -1
debug1: identity file /Users/jacobclark/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA a1:62:aa:51:0c:20:f3:3e:10:17:c7:20:a4:0b:7b:16
debug1: Host 'gitlab.' is known and matches the RSA host key.
debug1: Found key in /Users/jacobclark/.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,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/jacobclark/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /Users/jacobclark/.ssh/id_dsa
debug1: Next authentication method: password
git@gitlab's password: 

您需要關閉selinux: setenforce 0

我在CentO上遇到了完全相同的問題,原來是由於Centrify被用來管理ssh密鑰,這是非標准的,但是是我們公司服務器管理過程的一部分。

我對由另一個團隊管理的Centrify不太熟悉,但是我通過創建從gitlab的授權密鑰文件到/ etc / sshd / auth-keys / git的符號鏈接來解決了此問題。

AuthorizedKeys文件的值為我提供了需要鏈接到的符號鏈接的位置,該位置由sshd -T確定

結果解決了我的問題:

ln -s /var/opt/gitlab/.ssh/authorized_keys /etc/ssh/auth-keys/git

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM