On 2/4/20 1:36 PM, anilkumar panditi wrote:
> Hi Thank you for your reply,
> Now i am getting below error.
>
> "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@
> WARNING: UNPROTECTED PRIVATE KEY FILE!
> @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0644 for '/home/centos/openshift.pem'
> are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis private key will be
> ignored.\r\nLoad key \"/home/centos/openshift.pem\": bad permissions\r\nPermission denied
> (publickey,gssapi-keyex,gssapi-with-mic).",
> "unreachable": true
>
> My Inventory :=
> ============
> hdi_master1 ansible_host=13.234.186.61 ansible_connection=ssh ansible_user=centos
> ansible_ssh_private_key_file=/home/centos/openshift.pem
>
>
Well, I suppose you can read that error message and fix the permissions !?
Regards
Racke
>
>
> On Tuesday, 4 February 2020 17:49:13 UTC+5:30, Stefan Hornburg (Racke) wrote:
>
> On 2/4/20 1:11 PM, anilkumar panditi wrote:
> > Hi ,
> > I am trying to connect to ec2 instance using .pem file in ansible.
> > I am getting below error.
> >
> > fatal: [hdi_master1]: UNREACHABLE! => {
> > "changed": false,
> > "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).",
> > "unreachable": true
> > }
> >
> > my inventory:
> > ============
> >
> > # inventory of servers
> >
> > #ungrouped servers
> > hdi_master1 ansible_host=13.234.186.61 ansible_connection=ssh ansible_user=centos
> --private-key=/home/centos/openshift.pem
> >
> > even though i am passing i am getting above error .can anyone help me please.
>
> Your syntax in the inventory file is bogus, please try
>
> ansible_ssh_private_key_file=/home/centos/openshift.pem
>
> Regards
> Racke
>
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> >
ansible...@googlegroups.com <javascript:> <mailto:
ansible-proje...@googlegroups.com <javascript:>>.
> <
https://groups.google.com/d/msgid/ansible-project/fb8ec1ed-2346-417b-b056-171d65418f1e%40googlegroups.com?utm_medium=email&utm_source=footer
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
>
ansible-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/1ff8ed87-5558-47bb-902c-620c2072db73%40googlegroups.com
> <
https://groups.google.com/d/msgid/ansible-project/1ff8ed87-5558-47bb-902c-620c2072db73%40googlegroups.com?utm_medium=email&utm_source=footer>.