I am copying the public key of the pem file generated from External Box to all EC2 instances. This prompts for password for first time Therafter I am able to do scp to all EC2 instance without password using PEM_PATH.
After 1st run I am trying to check if external box is able to SSH into without password using below code
return_code=$(ssh -i $PEM_PATH $SWARM_UNAME@$SWARM_NODE)
But this is not returning.
PEM_PATH is the path to my pem file