私は最初のJenkinsのスレーブを設定しました。私はビルドを実行し、私はSSHのキーで問題を打つ。 マスターJenkinsサーバーがユーザー 'jenkins'のもとで実行されています。私はパスワードなしでマスターからスレーブにSSHできるようにSSHキーを設定しました。Jenkins - スレーブノードからクローンをgitできません。 SSHキー
マスターから:
[email protected]:~$ ssh slave
Last login: Tue Apr 17 10:30:22 2012 from masterjenkins.com
$ whoami
jenkins
だから、スレーブノードはまた、「ジェンキンス」ユーザで実行されていることを証明しています。 (私はjenkins @ slaveからリモートのgitサーバにパブリックssh鍵をコピーしました)。そして私は、スレーブから手動でgitのクローンを発行できるが、私はマスターからビルドをキックオフするとき、私は、メッセージのこれらの種類を取得:
ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:abc
hudson.plugins.git.GitException: Could not clone [email protected]:abc
Caused by: hudson.plugins.git.GitException: Error performing command: git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build
Command "git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
だからまだ私のSSHキーが設定されていないことをほのめかしています正しくアップ。 誰かどこにコピーする必要があるのか教えていただけますか?
多くのおかげで、あなたが二つの異なる認証方式を混合している表示されますクローンURLに基づいて NS
また、ホスト鍵の確認に失敗した場合は、Jenkinsユーザがそのサーバにssh接続されたことがなく、ホスト鍵を受け入れていないことを示すように見えるので、jenkinsユーザとしてCLIからsshを試して、ホストキー – Doon
@Doonこれは問題となる可能性があります。私はもともと、ジェンキンスが複製しようとしているのと同じマシンからsshを実行しようとしていると思っていました。 –
悪魔を手に入れました!すべてのあなたのご意見ありがとうございます。 jenkinsがスレーブ上で実行しようとしていたコマンドをコピーして貼り付けました: git clone --progress -o origin git @ host:abc/var/lib/jenkins/workspace/abc in /root/.ssh/known_hosts これらを削除してもう一度git repoに接続すると、うまくいきました! – nonshatter