# How to use ansible\_become for a root shell that needs an "enable" followed by a "su"?

**URL:** <https://forum.ansible.com/t/how-to-use-ansible-become-for-a-root-shell-that-needs-an-enable-followed-by-a-su/39021>\
**Category:** Guides, FAQs & Howtos\
**Tags:** howto\
**Created:** [December 10, 2024, 1:04pm UTC](https://forum.ansible.com/t/how-to-use-ansible-become-for-a-root-shell-that-needs-an-enable-followed-by-a-su/39021 "2024-12-10T13:04:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smeda](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/smeda/32/6936_2.png) [@smeda](https://forum.ansible.com/u/smeda)\
**Post date:** [December 10, 2024, 1:04pm UTC](https://forum.ansible.com/t/how-to-use-ansible-become-for-a-root-shell-that-needs-an-enable-followed-by-a-su/39021/1 "2024-12-10T13:04:19Z")

</div>

Here’s the sequence for my root login:  
**$ ssh [admin@10.0.34.210](mailto:admin@10.0.34.210)**  
[admin@10.0.34.210](mailto:admin@10.0.34.210)’s password: **…**  
ABC\_XYZ\> **enable**  
ABC\_XYZ# **su**  
Password: **…**  
[root@voe\_210:/tmp]$  
[root@voe\_210:/tmp]$ **exit**  
logout  
ABC\_XYZ# **exit**  
ABC\_XYZ\> **logout**  
Connection to 10.0.34.210 closed.  
$

To get a root shell, I need to use “su” advanced/enabled CLI command, with a password. I am not able to understand how to club this “su” with “enable”.

Since this is “help” topic (not a “howto”) , I have recreated/moved this here:

> [@Need help for getting a root shell on my custom network appliance](https://forum.ansible.com/t/need-help-for-getting-a-root-shell-on-my-custom-network-appliance/39086):
>
> My network appliance needs a non\_root ssh login, followed by an “enable” command, followed by an “su” command, followed by the root password. Here’s the sequence for my root login: $ ssh admin@10.0.34.210 admin@10.0.34.210's password: ... My\_Device\> My\_Device\>enable My\_Device# My\_Device#su Password: ...... [root@My\_Hostname:/tmp]$ [root@My\_Hostname:/tmp]$ exit logout My\_Device# My\_Device#exit My\_Device\> My\_Device\>logout Connection to 10.0.34.210 closed. $ I am able to get non-root shell (CLI) …
