Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As many of you already know, Cygwin doesn't have the sudo command, and it's recommended to use the runas command when you need root/administrator privileges. However, using runas creates a new cmd window to run the command in, which is not ideal (for me at least). What I'm looking for is a way to issue a sudo (or su) command and it still run seamlessly within the Cygwin shell. For example, if I want edit /etc/hosts I'd like to do so in the same window I issued the 'nano /etc/hosts' command in.

I've looked around for solutions, and sudo-for-cygwin seems pretty much perfect. Issue is that I can't get it to work (if someone is interested, this is the sudoserver.py code I try to run http://bpaste.net/show/UkMcxguGH2CgR0OXRIyP/ , and this is the error I get when I do so http://bpaste.net/show/nSp8athPoOrteCtffrlO/, and changing the port number does not seem to allow the script to complete). I've not coded in Python before, so unsure on how to debug this.

So I'm looking for ideas. I'm running Cygwin through Console2 (http://sourceforge.net/projects/console/), perhaps I could start Console2 using the Administrator account in some way? Really I'm stuck, so appreciate your input.

Thanks, Tom

share|improve this question
add comment

1 Answer

You can try ConEmu (I'm an author of it).

It is impossible to elevate process in current console, but you can run elevated (As Admin) process in new (even in background) tab of existing ConEmu window. There is -new_console switch, wich you may use anywhere inside ConEmu tabs. For example:

dism -new_console:a

Thought, you may create batch file sudo.cmd and place it in the %PATH%

%* -new_console:a
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.