我下載並在我的MacBook Pro安裝詹金斯的Mac OSX(OS:山獅)。我現在想要設置它從bitbucket中拉下一個項目並進行自動構建。詹金斯與失敗:主機密鑰驗證失敗
我創建SSH密鑰,添加它來到位桶,並試圖建立一個構建工作。但是,我得到的錯誤:
無法連接到存儲庫:命令「git的LS-遠程-h HEAD」返回的狀態碼128: 標準輸出: 標準錯誤:主機密鑰驗證失敗。 致命:遠程端意外掛斷
我試圖從known_hosts中刪除導致問題的域,但仍然出現此錯誤。
請指教。
我下載並在我的MacBook Pro安裝詹金斯的Mac OSX(OS:山獅)。我現在想要設置它從bitbucket中拉下一個項目並進行自動構建。詹金斯與失敗:主機密鑰驗證失敗
我創建SSH密鑰,添加它來到位桶,並試圖建立一個構建工作。但是,我得到的錯誤:
無法連接到存儲庫:命令「git的LS-遠程-h HEAD」返回的狀態碼128: 標準輸出: 標準錯誤:主機密鑰驗證失敗。 致命:遠程端意外掛斷
我試圖從known_hosts中刪除導致問題的域,但仍然出現此錯誤。
請指教。
我想我已經找到了這個帖子可能的解決方案:http://colonelpanic.net/2011/06/jenkins-on-mac-os-x-git-w-ssh-public-key/
Jenkins on Mac OS X I just finished setting up a build server on Mac OS X using Jenkins (formerly Hudson). The company I’m working for (GradeCam) uses git and gitolite for our source control and so I expected no trouble using Jenkins to build our tools using the git plugin.
However, I quickly ran into a snag: the source control server is on a public address and so our source code is not available except via ssh, and gitolite ssh access uses private key authentication. Well, I’m an experience unix sysadmin, so that didn’t sound like a big issue — after all, setting up public key authentication is childs play, right?
Default install
The default installation of Jenkins on Mac OS X (at the time of this writing) installs a Launch Agent plist to /Library/LaunchAgents/org.jenkins-ci.plist. This plist file causes Jenkins to load as user 「daemon」, which sounds fine — except that the home directory for the 「daemon」 user is /var/root, same as for user root. This means that the .ssh dir in there will never have the right permissions for a private key to be used.
Creating a new hidden user
My solution was to create a new 「hidden」 user for Jenkins to run under. Following instructions I found on a blog post, I created a user 「jenkins」 with a home directory 「/Users/Shared/Jenkins/Home」:
sudo dscl . create /Users/jenkins sudo dscl . create /Users/jenkins PrimaryGroupID 1 sudo dscl . create /Users/jenkins UniqueID 300 sudo dscl . create /Users/jenkins UserShell /bin/bash sudo dscl . passwd /Users/jenkins $PASSWORD sudo dscl . create /Users/jenkins home /Users/Shared/Jenkins/Home/
I then stopped Jenkins:
「sudo launchctl unload -w /Library/LaunchAgents/org.jenkins-ci.plist」
and edited the plist file to set the username to jenkins instead of daemon.「chown -R jenkins: /Users/Shared/Jenkins/Home」
sets the permissions how they need to be, and then
「sudo launchctl load -w /Library/LaunchAgents/org.jenkins-ci.plist」
should get you up and running!To get git over ssh running, 「sudo su – jenkins」 to get a console as the jenkins user and set up the ssh keys and such. Make sure you can ssh to where you want to go (or even do a test git clone) because you need to save the keys so it doesn’t ask for them when jenkins tries to do the clone.
That should do you! Hope it helps someone.
請確保你的答案不依賴於一個URL。當URL死亡時,他們需要持續通過。 – StarWind0
完成,感謝您的反饋 – Claus