# Unable to use specified private key when connecting as a different user

**URL:** <https://forum.ansible.com/t/unable-to-use-specified-private-key-when-connecting-as-a-different-user/26680>\
**Category:** Ansible Project\
**Created:** [February 8, 2018, 8:33am UTC](https://forum.ansible.com/t/unable-to-use-specified-private-key-when-connecting-as-a-different-user/26680 "2018-02-08T08:33:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![0lai.m.mariano](https://avatars.discourse-cdn.com/v4/letter/0/a9adbd/32.png) [@0lai.m.mariano](https://forum.ansible.com/u/0lai.m.mariano)\
**Post date:** [February 8, 2018, 8:33am UTC](https://forum.ansible.com/t/unable-to-use-specified-private-key-when-connecting-as-a-different-user/26680/1 "2018-02-08T08:33:11Z")

</div>

Scenario - I am logged in to my Ansible server as “0lai” but would like to run my testPlay.yml as a different user (“ansible”) so I used the —user option. However, I don’t know user ansible’s password and would like to make it a passwordless run. I used thee —key-file option and provided the private key file of user ansible. This fails because user 0lai does not have read permission on user ansible’s private key. When i tried to give group read permission to ansible, it worked as expected. However, the private key shouldn’t be readable to anyone but the owner right?

Is there any way I can, as “0lai”, use “ansible” to connect to my managed nodes passwordlessly?
