# Ansible root scenario

**URL:** <https://forum.ansible.com/t/ansible-root-scenario/26440>\
**Category:** Ansible Project\
**Created:** [January 9, 2018, 3:22am UTC](https://forum.ansible.com/t/ansible-root-scenario/26440 "2018-01-09T03:22:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aveek\_Roy](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@Aveek\_Roy](https://forum.ansible.com/u/Aveek_Roy)\
**Post date:** [January 9, 2018, 3:22am UTC](https://forum.ansible.com/t/ansible-root-scenario/26440/1 "2018-01-09T03:22:33Z")

</div>

Hi All,

We have an inquiry regarding ansible.

Presently we have a server, where ansible is installed (say **A** ) and we are running commands to a remote server (say **B** ) using ansible, which tells that ansible is SSH authenticated.

Below is the sequence of steps using which, we login to the server **B** (manually):

1. I am logging to a server using user (say **abc** )
2. After that, abc needs to become root using pbrun utility (say **pbrun /bin/su -** ), following which it becomes another user (say xyz) using command **su - xyz**

In this scenario, we have SSH id\_rsa.pub key of user **abc** in authorized\_keys of **root**.ssh directory. If we do that, we are able to successfully connect, but this approach is not feasible in our case as abc user pub key cannot be placed in root’s ssh directory.

Is there any other alternative to this scenario for ansible so that we don’t have to add the pub key of abc user to root .ssh directory and still be able to use agentless architecture of ansibe?

Let us know if there is any resolution to this issue.

Regards,  
Aveek
