2012-10-30 5 views
2

Macbook Pro 용 Jenkins를 다운로드하여 설치했습니다 (OS : Mountain Lion). 이제는 bitbucket에서 프로젝트를 풀고 자동 빌드를 수행하도록 설정하려고합니다.Jenkins와 함께 실패 : 호스트 키 확인에 실패했습니다.

ssh 키를 생성하여 bitbucket에 추가하고 빌드 작업을 설정하려고했습니다. 그러나, 나는 오류를 얻을 :

는 저장소에 연결하지 못했습니다 : 표준 출력 : 표준 에러 : 실패 키 확인을 호스트 명령 "자식 LS-원격 -h HEAD는"상태 코드 128를 반환했습니다. 치명적인 : 원격 장치가 예기치 않게 끊어졌습니다.

known_hosts에서 문제를 일으키는 도메인을 제거하려고했지만 여전히이 오류가 발생합니다.

알려 주시기 바랍니다.

답변

2

는 나는이 게시물에 가능한 해결책을 찾은 것 같아 : 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.

+1

답이 URL에 의존하지 않는 있는지 확인하십시오. 그들은 URL이 죽을 때 마지막으로 통과해야합니다. – StarWind0

+1

완료, 피드백 주셔서 감사합니다. – Claus

관련 문제