2014-02-19 34 views
0

我們使用Active Directory進行gerrit認證,並添加了我們的ssh-public key來訪問git repos。如果我們在Linux中使用與AD用戶相同的用戶名,我們可以很好地工作。但是我們的一些工作需要在Linux機器中使用root用戶,所以我們希望完全使用root用戶來克隆git repos並將更改推送到gerrit。gerrit:通過使用另一個用戶的公鑰,以root用戶身份訪問gerrit存儲庫

但是,當我們試圖從克隆root用戶,我們正在以下錯誤消息的git回購

git clone ssh://gerrit.doamin.com:29418/gitrepo.git 
Cloning into 'girepo... 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists 

我抄現有gerit用戶的SSH密鑰對,以/root/.ssh但還是我面臨同樣的問題。

是否可以通過複製另一個gerrit用戶的公鑰來訪問gerrit中的git repos?

+0

請提供更多的細節。你用來克隆的命令是什麼?你在Gerrit服務器/ AD中包含用戶的用戶名? – StephenKing

+0

沒有StephenKing,我沒有在URL中包含AD用戶。用命令編輯我的問題我試過 – Sridhar

回答

0

我從gerrit google羣體社區獲得answer。感謝「大衛·奧斯特洛夫斯基」

添加一個SSH別名/root/.ssh/config和克隆命令使用它:

Host gerrit 
    HostName <gerrit server> 
    User joe 
    Port 29418 
+1

當然,這很明顯,那正是我所要求的。 Gerrit服務器應該如何知道用戶名。如果不設置'.ssh/config',你可以使用這個克隆命令:'git clone ssh://[email protected]:29418/gitrepo.git'。 – StephenKing

+0

謝謝StephenKing .. – Sridhar

相關問題