I'm trying to run an Ansible ad hoc command via SSH on a Ubuntu 14 LTS server:
ansible all -m ping -u myusername
However I get the following error message:
FAILED => SSH Error: Permission denied (publickey,password)
When I try to run the ad command with the flag for asking a password, it works:
ansible all -m ping -u myusername --ask-pass
absence.ugent.be | success >> {
"changed": false,
"ping": "pong"
}
Does anyone know why the command doesn't work without asking for my password? And how I can solve this?
update: as neuhaus suggested, I tried to remove the pass phrase from my ssh keyfile with:
ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
But that didn't fix it. The odd thing is that I can still successfully run
ansible all -m ping -u myusername --ask-pass
with my old pass phrase, even after creating a new ssh key.
Thanks for your help,
Anthony