# For those interested in working on/with sudo...

**URL:** <https://forum.ansible.com/t/for-those-interested-in-working-on-with-sudo/11379>\
**Category:** Ansible Project\
**Created:** [March 29, 2012, 2:56am UTC](https://forum.ansible.com/t/for-those-interested-in-working-on-with-sudo/11379 "2012-03-29T02:56:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 29, 2012, 2:56am UTC](https://forum.ansible.com/t/for-those-interested-in-working-on-with-sudo/11379/1 "2012-03-29T02:56:51Z")

</div>

I’ve added some code to connection.py which _SEEMS_ like what you want to do for sudo support, but I’m seeing some issue with paramiko saying the connection is closed right after I send the command.

More debugging is required, but if folks interested in working on sudo want to hack at it, look at connection.py and search for “sudo”. You will have to remove the “if not False” line and then also set sudo=True in Runner for now.

(Worst case scenario is probably that sudo support might not be possible except on newer (client) distributions… to be determined, we should be able to get this working)

–Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 29, 2012, 3:33am UTC](https://forum.ansible.com/t/for-those-interested-in-working-on-with-sudo/11379/2 "2012-03-29T03:33:21Z")

</div>

I've managed to upgrade this quite a bit. It still seems to need to  
wait better to get the results (recv\_ready) in connection -- basically  
we need to do some things to use the tool in shell mode but still be  
able to figure out what in the shell is JSON and what is not.

Working on this. Pushed what is there so far, but turned off (sudo=False).
