I’m new to Ansible. I know I can add the ssh keys to the remote host(s) and that works. But I was wondering if there is a way to do it without sharing keys and just putting a password every time the Ansible playbook is executed.
Could you please explain how they’re not working? Using --ask-pass is the correct option to have Ansible prompt you for a password. If you’re using SSH as your connection type (or “smart”, on a system that is not RHEL/CentOS 6), you can also add -vvvv to get SSH debugging info printed out.
this what I get, I’m using the same password as I used for my ssh login above.
SSH password:
<x.x.x.x> ESTABLISH CONNECTION FOR USER: myuserid
x.x.x.x | FAILED => to use the ‘ssh’ connection type with passwords, you must install the sshpass program
Do I really need sshpass for this work ? I’m on a OS-X (12.5.0 Darwin Kernel Version 12.5.0: Mon Jul 29 16:33:49 PDT 2013; root:xnu-2050.48.11~1/RELEASE_X86_64 x86_64) and looks like it’s not easy to install sshpass using port or brew.
I am facing a similar issue.
I have non-root access to a server to which i am able to connect manually.
But ansible throws “to use the ‘ssh’ connection type with passwords, you must install the sshpass program” error when i execute the playbook.
My hosts file contains the ip address and credentials to login to that server in the below format
ip ansible_ssh_user=“non-root-user” ansible_ssh_pass=“password”
Is it necessary to install sshpass on the remote node as well??
I do not have root access, so how do i go about it?
Did you install the package "sshpass" on the control machine? (Non-interactive ssh password authentication).
Ansible doesn't require openssh-server on the control machine, but when you are using ssh with password the program "sshpass" is needed on the control machine since ssh doesn’t provide this functionality itself.
I have installed openssh-server and openssh-clients on the control machine using yum.
And still getting the error: | FAILED => to use the ‘ssh’ connection type with passwords, you must install the sshpass program