I am able to ssh to an ec2 instance using putty and .ppk file.
when trying to do the same from build server, i am getting ssh error
things that i have tried
- inventory file:
[aws-hosts]
10.20.30.40 [ changed ip for the post]
[aws-hosts:vars]
ansible_ssh_private_key_file=/tmp/devhosts.ppk
then ran
ansible aws-hosts -u ec2-user -i invent -m ping
getting the below error
ESTABLISH SSH CONNECTION FOR USER: ec2-user
SSH: EXEC ssh -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey,keyboard-interactive -o ControlMaster=auto -o ControlPersist=300 -o StrictHostKeyChecking=no -o ‘IdentityFile=“/tmp/devhosts.ppk”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=120 -o ControlPath=/home/xxxxx/.ansible/cp/7f5a8fa6ee xxxxxx ‘/bin/sh -c ‘"’"’/usr/bin/python && sleep 0’“'”‘’
xxxxxxxx | UNREACHABLE! => {
“changed”: false,
“msg”: “SSH Error: data could not be sent to remote host "xxxxxxxxx". Make sure this host can be reached over ssh”,
“unreachable”: true
}
replaced ip with ‘xxxxxxx’
-
tried to replace the ppk file in the inventory file with .pem file still same error
-
tried --key-file in the ansible command line instead of the inventory file.
-
tried --private-key in the ansible command line
get the same error for all.