# Ensure that file 1 (authorized\_keys) contains file 2 (id\_ed25519.pub)

**URL:** <https://forum.ansible.com/t/ensure-that-file-1-authorized-keys-contains-file-2-id-ed25519-pub/19673>\
**Category:** Ansible Project\
**Created:** [November 2, 2015, 10:34pm UTC](https://forum.ansible.com/t/ensure-that-file-1-authorized-keys-contains-file-2-id-ed25519-pub/19673 "2015-11-02T22:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uwe\_Sauter](https://avatars.discourse-cdn.com/v4/letter/u/41988e/32.png) [@Uwe\_Sauter](https://forum.ansible.com/u/Uwe_Sauter)\
**Post date:** [November 2, 2015, 10:34pm UTC](https://forum.ansible.com/t/ensure-that-file-1-authorized-keys-contains-file-2-id-ed25519-pub/19673/1 "2015-11-02T22:34:05Z")

</div>

Hi all,

just beginning my adventure with Ansible.

Following situation: I'm trying to ensure that a user called "ansible" is present on all hosts that should be managed by Ansible.  
Creating group and user works so far. Now I'm trying to enable password-less SSH login for that user by copying a well known key  
pair to the host.

### playbook.yml

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 2, 2015, 11:47pm UTC](https://forum.ansible.com/t/ensure-that-file-1-authorized-keys-contains-file-2-id-ed25519-pub/19673/2 "2015-11-02T23:47:53Z")

</div>

that is what the authorized\_keys module is for  
[http://docs.ansible.com/ansible/authorized\_key\_module.html](http://docs.ansible.com/ansible/authorized_key_module.html), use that  
instead to copy the public key. Also you should not be copying the  
private key.

---

<div class="post-metadata">

**Author:** ![Uwe\_Sauter](https://avatars.discourse-cdn.com/v4/letter/u/41988e/32.png) [@Uwe\_Sauter](https://forum.ansible.com/u/Uwe_Sauter)\
**Post date:** [November 3, 2015, 4:19pm UTC](https://forum.ansible.com/t/ensure-that-file-1-authorized-keys-contains-file-2-id-ed25519-pub/19673/3 "2015-11-03T16:19:26Z")

</div>

Thanks Brian!
