在 rundeck 中添加远程节点 [英] Add a remote node in rundeck

查看:61
本文介绍了在 rundeck 中添加远程节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够使用 Rundeck 在远程节点上执行 shell 命令,我发现了 这个视频 解释了如何做到这一点,但我不了解私钥部分以及如何配置它.我不断收到以下错误:

I want to be able to execute shell commands on remote nodes using Rundeck and I found this video that explains how to do that but I don't understand the private-key part and how to configure it. I keep getting the following error:

连接到节点的身份验证失败:test-001".确保您的资源定义和凭据是最新的.失败的:AuthenticationFailure:连接到节点的身份验证失败:测试-001".确保您的资源定义和凭据已启动迄今为止.

Authentication failure connecting to node: "test-001". Make sure your resource definitions and credentials are up to date. Failed: AuthenticationFailure: Authentication failure connecting to node: "test-001". Make sure your resource definitions and credentials are up to date.

我设置了一个远程服务器,并配置了如下所示的 resource.xml 文件:

I have a remote server set up and I configured the resource.xml file like the following:

<node name="test-001" description="demo for test" tags="demo" hostname="10.10.10.10:22"  osFamily="unix" osName="Linux" osVersion="2.6.32" username="demo"  />

我是否需要将 ssh-key 值添加到 xml 文件中?如果是这样,我是否必须将公钥或私钥从 Rundeck 服务器复制到主机服务器?
另外,用户名demo也是有密码的,怎么定义呢?

Do I need to add the ssh-key value to the xml file? If so, do I have to copy the public or private keys from the Rundeck server to the host server?
Also, the username demo has a password too, so how can I define it?

推荐答案

Rundeck 主机服务器通过私钥认证的方式连接到节点,这与 SSH 私钥认证完全相似.按照以下步骤将节点添加到您的服务器 rundeck.

Rundeck host server connects to the node by means of private key authentication which is exactly similar to SSH private key authentication. Follow these steps to add a node to your server rundeck.

打开 resources.xml 文件并添加以下内容.

Open up the resources.xml file and add the following.

<node name="rundeck node2" description="Rundeck node2" tags="node2" hostname="10.1.0.1" osArch="amd64" osFamily="unix" osName="Linux" osVersion="3.11.10-03111015-generic" username="leo" ssh-keypath="/var/lib/rundeck/node2.key"/>

您可以更改节点中的 SSH 用户名和私钥文件名.除此之外,您还可以更改所有其他命名参数,例如节点名称和标签等.

You can change the SSH user name in node and private key file name. In addition to that, you can change all the other naming parameters too like node name and tags etc.

现在进入您的节点服务器.

Now get into your node server.

  1. 创建一个 ssh 用户,这里是 leo
  2. 切换到用户 leo.生成 SSH 密钥
  3. ssh-keygen
  4. 将公钥附加到authorized_keys
  5. leo@c1a5f48a6c4c:~/.ssh$ pwd/home/leo/.sshleo@c1a5f48a6c4c:~/.ssh$ cat id_rsa.pub >>授权密钥leo@c1a5f48a6c4c:~/.ssh$ chmod g-w authorized_keys
  6. 复制私钥
  7. leo@c1a5f48a6c4c:~/.ssh$ cat id_rsa

将私钥保存到 rundeck 主机上的文件/var/lib/rundeck/node2.key".现在身份验证正常,可以从 rundeck 仪表板执行临时命令

Save the private key to the file "/var/lib/rundeck/node2.key" on rundeck host. Now the authentication is okay and ready to execute adhoc commands from rundeck dashboard

这篇关于在 rundeck 中添加远程节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆