Generating a 2048 bit RSA private key
.....................................+++
.........................................................+++
writing new private key to '/etc/nginx/rundeck.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:SR
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:Zemoon
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:rundeck.test.com
Email Address []:

I’ll be adding Domain Controller to Rundeck, so i created Domain user and put it in Built-in Administrator group,username:rundeck@test.com

Installing OpenSSH server on Windows Server

In order to run inline scripts against Windows server we need password-less connection to Windows server (private/public key authentication), because Rundeck first copies script to remote node before executing it

Download OpenSSH server,unzip it and copy it to desired destination (i put it in C:\Program Files)

With powershell browse to unzipped folder and run ./install-sshd.ps1

Two services should be installed:sshd and ssh-agent,make sure both are running-set Startup type to Automatic

Add following line for every new node (server which needs to be managed)

New node appears in Web interface

To add another node just copy node line and change name and node IP address

Creating keypair on Rundeck server

ssh-keygen

Copy private key to clipboard:

cat /root/.ssh/id_rsa

copy content to clipboard

Now, on Rundeck interface click settings (cog icon)-Key Storage

Click Add or Upload a Key

Make sure Private Key is selected from drop-down list, paste content of ~/.ssh/id_rsa
And give key a name. Note:storage path and key name must reflect names in /var/rundeck/projects/etc resources.xml file (ssh-key-storage-path=”keys/Linuxtopic/server.key”)

Instead of Private/Public keys, password can be used as authentication method

On client (node) create authorized_keys file (under /root/.ssh)
Copy content of id_rsa.pub file (public key) from Rundeck server to authorized_keys file on node machine
Repeat same step for every new node (copy public key from Rundeck server to /root/.ssh/authorized_keys file on every node

Running command

Now when we added node, we can run command on it, from Rundeck server go to commands-type command
From nodes, type node name-Click Run on node

Key storage

Private key uploaded to Rundeck server in previous steps are located locally on Rundeck server