0

In target server need to run a command like "mcs cmh" which prompts for password to become root user... how can I achieve the same in become method?

Bindu G
  • 105
  • 2
  • 10
  • Ansible [Understanding privilege escalation: become](https://docs.ansible.com/ansible/latest/user_guide/become.html). – U880D Nov 23 '21 at 13:15
  • You may also take advantage from [How to store `ansible_become_pass` in a vault and how to use it?](https://stackoverflow.com/questions/37297249/) – U880D Nov 23 '21 at 13:18
  • 1
    @U880D In the ansible documentation, I couldn't find that we can use custom command to become different user. allowed methods for `become_method` are `privilege escalation method to use (default=sudo), valid choices: [ sudo | su | pbrun | pfexec | doas | dzdo | ksu | runas | machinectl ]` – Bindu G Nov 23 '21 at 13:23
  • If you like "_to become different user_" than `root`, you may have a look into [Become directives `become_user`](https://docs.ansible.com/ansible/latest/user_guide/become.html#become-directives). – U880D Nov 23 '21 at 18:11

0 Answers0