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
- 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/id_rsa.pub.
- Private key :in /home/demo/.ssh/id_rsa.
Copy the public key to RA agent machine authorized key. Command
- 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
- 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.