Failed to connect to the host via ssh: kex_exchange_identification: Connection closed by remote host

I try to config on inventory file as the following
ansible_port = 22
ansible_user = ec2-user
private_key_file = /mnt/e/DEVELOPMENT/PROJECTS/test.pem
ansible_ssh_common_args= ‘-o ProxyCommand=“ssh -q omtnc@bastionip -o IdentityFile=/mnt/e/DEVELOPMENT/PROJECTS/key.ppk -o Port=22”’

when i run playbook file, it show error as the following

do you know why it can not to remote host?


We’d need more detailed traces on this, but I’m pretty sure you can’t use ppk keys with OpenSSH. You could try to convert it first in OpenSSH format, see if it solves your issue. We’ll take it from there.

1 Like

I could connect to remote host. Thank you so much.

1 Like