SSH Actions Run Command with ssh_keys

Document ID : KB000093128
Last Modified Date : 27/04/2018
Show Technical Document Details
How to configure "RUN Command Line (SSH)" action to run via ssh-keys setup to establish trust between remote servers.
When we are trying to "Run Command (SSH)" and want this action to use ssh-keys generated to establish trust between server it is failing with an error asking for password. This action is unable to pick the keystore file. The issue is related to incorrect configuration of ssh-keys between the remote servers.
Release Automation: 6.5, 6.6
Linux: RedHat 6,7
Steps to setup ssh-key trust
  1. Generate a ssh-key on target machine which we want to connect from RA agent machine remotely. Command is ssh-keygen -t rsa. Follow the on-screen instruction and it will generate two keys
    • Public key: /home/demo/.ssh/
    • Private key :in /home/demo/.ssh/id_rsa.
  2. Copy the public key to RA agent machine authorized key. Command ssh-copy-id demo@RA_AGENT_MACHINE_IP/HOSTNAME
  3. Validation: To validate that the RA agent server is having correct public key from the target machine you can run command ssh-keygen -l -f authorized_keys
  4. Configure the action "Run Command Line(SSH)" and mention the password for keystore.

In case the action fail for some reason related to authentication please check  /etc/ssh/sshd_config  on destination server, as there are some configuration set explicitly which can protect key based login.