# Ansible playbook, trying to execute ssh-copy-id to remote host for passwd less login,

**URL:** <https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834>\
**Category:** Ansible Project\
**Created:** [December 17, 2019, 12:10pm UTC](https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834 "2019-12-17T12:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ganeshwari\_Sk](https://avatars.discourse-cdn.com/v4/letter/g/ea5d25/32.png) [@Ganeshwari\_Sk](https://forum.ansible.com/u/Ganeshwari_Sk)\
**Post date:** [December 17, 2019, 12:10pm UTC](https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834/1 "2019-12-17T12:10:52Z")

</div>

Hi,

I am new for ansible. I wrote the following playbook to execute the ssh-copy-id to copy the id\_rsa.pub key to remote host, but I am getting permission denied error or hanging when passing password as argument,

Playbook :

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [December 17, 2019, 2:36pm UTC](https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834/2 "2019-12-17T14:36:46Z")

</div>

> Hi,
> 
> I am new for ansible. I wrote the following playbook to execute the ssh-copy-id to copy the id\_rsa.pub key to remote  
> host, but I am getting permission denied error or hanging when passing password as argument,

1. Make sure that Ansible is able to connect via SSH.

2. Use authorized\_keys module.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
