On the Rundeck Server go to $HOME directory of rundeck user
cd /home/rundeck
mkdir .ssh
cd .ssh
touch authorized_keys
touch known_hosts
ssh-keygen -t rsa
Use the Path /home/rundeck/.ssh/id_rsa
id_rsa and id_rsa.pub will be created.
echo "Content of id_rsa.pub" >> authorized_keys
echo "Content of id_rsa.pub" >> known_hosts
Copy the contents of id_rsa.pub, login to Target Node and go to Userid $HOME/.ssh which is used for login
cd $HOME/.ssh
touch authorized_keys
touch known_hostsecho "Content of id_rsa.pub" >> authorized_keys
echo "Content of id_rsa.pub" >> known_hosts
Click on Settings -> Key storage -> Click on "Add or Upload a Key"
Key Type -> Private Key
Add the content into Enter Test box and Click Save
Now go to Project Settings -> Edit Configuration -> select SSH Authentication privateKey
or
Set the following in the Project Settings -> Edit Configuration -> Edit Configuration File
project.ssh-authentication=privateKey
project.ssh-key-passphrase-storage-path=keys/Login-Server
project.ssh-key-storage-path=keys/Login-Server
project.ssh-key-passphrase-storage-path=keys/Login-Server
project.ssh-key-storage-path=keys/Login-Server
Now Click on JOBS -> select or create a job -> on workflow tab -> add steps
Run the job