# Ansible .ssh/authorized.key

**URL:** <https://forum.ansible.com/t/ansible-ssh-authorized-key/30668>\
**Category:** Ansible Project\
**Created:** [June 27, 2019, 12:15pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668 "2019-06-27T12:15:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [June 27, 2019, 12:15pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/1 "2019-06-27T12:15:58Z")

</div>

Hy all,

when i use become\_user: wildfly

i have have this message error :

path /home/wildfly/.ssh/authorized\_keys does not exist

But this path exist in destination host…

Someone have idea please ??!

Thanks community ansible for your help !! 😉

ansible version : 2.8

Regards,

---

<div class="post-metadata">

**Author:** ![The\_Vandyy\_Vines](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@The\_Vandyy\_Vines](https://forum.ansible.com/u/The_Vandyy_Vines)\
**Post date:** [June 27, 2019, 12:18pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/2 "2019-06-27T12:18:13Z")

</div>

May check permissions of authorized\_keys

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [June 27, 2019, 12:32pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/3 "2019-06-27T12:32:54Z")

</div>

Hy,

Thanks for your answer,  
I look permission of authorized\_keys but i use user wildfly of /home/wildfly/.ssh/authorized\_keys  
So the problem is not if there is permission or not ??

I use :

become\_user: wildfly

Thanks for your help !!

Regards,

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [June 27, 2019, 12:55pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/4 "2019-06-27T12:55:42Z")

</div>

Hy,

For answer, i have this permissions for authorized\_keys with user wildfly :

-rw------- 1 wildfly wildfly 7445 Jun 27 12:05 authorized\_keys

Thanks,

Regards,

---

<div class="post-metadata">

**Author:** ![P.Cookson](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@P.Cookson](https://forum.ansible.com/u/P.Cookson)\
**Post date:** [June 27, 2019, 1:12pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/5 "2019-06-27T13:12:11Z")

</div>

Have you checked permissions on /home/wildfly/.ssh/ too? That needs to be 700 (rwx) – see eg below:

[root@]# ls -ld /home/wildfly/.ssh

drwx------. 2 wildfly wildfly 4096 Jun 7 14:26 /home/ wildfly /.ssh

[root@]#

Regards

Phil

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [June 27, 2019, 2:55pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/6 "2019-06-27T14:55:22Z")

</div>

Hy,

I check it and all is ok but not works… When i changed permission 777 it’s works.

I thinks that it’s problem of user use ? but i have the well user … with this command:

become\_user: wildfly

Thinks,

Regards,

---

<div class="post-metadata">

**Author:** ![P.Cookson](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@P.Cookson](https://forum.ansible.com/u/P.Cookson)\
**Post date:** [June 27, 2019, 3:23pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/7 "2019-06-27T15:23:38Z")

</div>

What task are you trying to perform eventually? If it’s something like adding a new package, you may need to connect with the normal wildfly user first and then become root. If so, something like similar might be more appropriate:

**- name: Test**

**hosts: all**

**remote\_user:**  **wildfly**

**become: yes**

**become\_method: sudo**

Regards

Phil

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [June 27, 2019, 3:44pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/8 "2019-06-27T15:44:24Z")

</div>

Hy,

Thank you very much for your help i have solve this problem.

Thanks for your help !! 🙂

Regards,

---

<div class="post-metadata">

**Author:** ![P.Cookson](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@P.Cookson](https://forum.ansible.com/u/P.Cookson)\
**Post date:** [June 27, 2019, 3:48pm UTC](https://forum.ansible.com/t/ansible-ssh-authorized-key/30668/9 "2019-06-27T15:48:14Z")

</div>

Did my suggestion work for you or did you resolve it in some other way?

Regards

Phil
