Re: [ansible-project] Need assistance using SSH keys and Ansible

14 views
Skip to first unread message

Dick Visser

unread,
May 10, 2019, 10:06:54 AM5/10/19
to ansible...@googlegroups.com
On Thu, 9 May 2019 at 17:27, Michael Woods <mikeaw...@gmail.com> wrote:
>
> Hello.
>
> I'm attempting to connect via Ansible to a remote linux based server. When I attempt:
> ansible all -m ping -u <username>
>
> I receive the following errors:
>
> X.X.X.X | UNREACHABLE! => {
>
>
> "changed": false,
>
>
> "msg": "Failed to connect to the host via ssh: <username>@x.x.x.x: Permission denied (publickey,password).",
>
>
> "unreachable": true
>
>
> }
>
> (IP and username were discarded for confidentiality purposes.)
>
> I'm able to execute the command successfully if I use the --ask-pass option, however; I was hoping to get it to automatically authorize PC machine via ssh keys.
>
> On the Linux Server, I am able to see my PC's ssh key under: '~/.ssh/authorized_keys'
>
> From my understanding, the server would need the ssh key of my PC for my PC to authenticate with it? OR is it the other way around? My MAC-Book does not have an authorized_keys file.

Hi
This isn't an ansible problem.
Take a look at some general SSH public key authentication pages, for instance:

https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages