using 'sudo bash' to elevate user permission with ansible

会有一股神秘感。 提交于 2021-01-28 23:30:38

问题


I am currently working on a system that the only way to become root is via the command "sudo bash". My intentions are to use Ansible to install dependencies and configure files, and the currently documented methods of privilege escalation do not work with my current system setup.


回答1:


If only sudo bash is available for you, then ansible with a controler <-> remote host connection is not a good candidate as this is a known limitation of the privilege escalation feature.

To explain a bit further, Ansible module commands are sent to the remote host using the current remote_user as temporary python serialized files. For privilege escalation, those files are run with sudo. See a more detailed description of how this works here.

You can still run ansible after becoming root directly on the host (targeting localhost in you playbook). You may want to have a look at ansible pull which will let you fetch and run a playbook out of a VCS like git.



来源:https://stackoverflow.com/questions/56008555/using-sudo-bash-to-elevate-user-permission-with-ansible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!