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.
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"/>
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.
- Create a ssh user, here its leo
- switch to user leo. Generate a SSH key
- ssh-keygen
- Append the public key to authorized_keys
leo@c1a5f48a6c4c:~/.ssh$ pwd
/home/leo/.ssh
leo@c1a5f48a6c4c:~/.ssh$ cat id_rsa.pub >> authorized_keys
leo@c1a5f48a6c4c:~/.ssh$ chmod g-w authorized_keys
- Copy the private key
leo@c1a5f48a6c4c:~/.ssh$ cat id_rsa
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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…