there is a confusion
ssh -vv -i .ssh/authorized_keys -o PasswordAuthentication=no [email protected] authorized_keys is a list of public keys you allow to connect.
this file should be set on server side.
you must connect using your private keys, likely
ssh -i .ssh/id_rsa [email protected] step 1 (client)
connect to 192.168.12.10 with user ansible and type:
mkdir .ssh ; chmod go-rwx .ssh ; cd .ssh ssh-keygen -t rsa Accept default option, do not set password.
Do this only one, do not do it if there is already a pair of key.
if password for ansible is know, copy file id_rsa.pub using
scp id_rsa.pub [email protected]:.ssh/id_rsa_ansible.pub The first time you ssh or scp from 192.168.12.10 to 192.168.12.2, you will have a confirmation dialog.
[email protected]:hosts.ansible The authenticity of host '192.168.12.10' can't be established. RSA key fingerprint is 89:dc:fe:d6:4a:40:28:e5:e9:d0:bd:09:28:01:93:23. Are you sure you want to continue connecting (yes/no)? y if password in unknow or unset, copy the line from id_rsa.pub using putty buffer
step 2 (server)
Connect to 192.168.12.2 with user ansible
mkdir .ssh ; chmod go-rwx .ssh ; cd .ssh Create authorization files
cat id_rsa_ansible.pub >> authorized_keys or copy/paste content of id_rsa.pub file from ansible
authorized_keys must :
belong either to ansible (or root)
chown ansible authorized_keysansible must be only writer (rw-r--r--)
chmod 644 authorized_keys
verification
connect to 192.168.12.10 with user ansible
ssh [email protected] You should connect without having to type password
I already have a web page detailing those steps (in french and english), you can enter usernames and hostnames. 