为Gerrit和Hudson创建SSH密钥

为Gerrit和Hudson创建SSH密钥

本文介绍了为Gerrit和Hudson创建SSH密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 Hudson 插件。



无论出于何种原因, Gerrit 不接受位于 /var/lib/hudson/.ssh/id_rsa的 SSH / code>。



在GUI中获得连接错误:com.jcraft.jsch.JSchException :身份验证失败作为错误,当我在终端中 时,我得到一个权限被拒绝(publickey) error。



如何生成并使用工作私钥,使 Hudson 和 Gerrit 可以打得好吗? 设法排除它:

我的原始建议如下:




使用基于Web的代码审查系统Gerrit的用户是什么?



该用户需要您的 /var/lib/hudson/.ssh/id_rsa.pub 其 $ HOME / .ssh / authorized_keys ,如所示。





密钥分配



 #首先将公钥从客户端上传到服务器
client $ scp〜/ .ssh / id_rsa.pub server.example.org:

#接下来,在服务器
server $ mkdir〜/ .ssh $ b上设置公钥$ b server $ chmod 700〜/ .ssh
server $ cat〜/ id_rsa.pub>> 〜/ .ssh / authorized_keys
server $ chmod 600〜/ .ssh / authorized_keys
server $ rm〜/ id_rsa.pub







I'm trying to use the Hudson Gerrit Trigger plug-in.

For whatever reason, Gerrit is not accepting the SSH key located at /var/lib/hudson/.ssh/id_rsa.

In the GUI I get Connection error : com.jcraft.jsch.JSchException: Auth fail as an error, and when I'm working in the terminal I get a Permission denied (publickey) error.

How can I generate and use a working private key so Hudson and Gerrit can play nice?

解决方案

The OP Josh Smith managed to sort it out:

My original advice is below:


What is the user which will use the web based code review system Gerrit?

That user needs your /var/lib/hudson/.ssh/id_rsa.pub public ssh key in its $HOME/.ssh/authorized_keys, as illustrated in this guide.

Key Distribution

# first, upload public key from client to server
client$ scp ~/.ssh/id_rsa.pub server.example.org:

# next, setup the public key on server
server$ mkdir ~/.ssh
server$ chmod 700 ~/.ssh
server$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/id_rsa.pub


这篇关于为Gerrit和Hudson创建SSH密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 06:08