I use sudo a lot and I am constantly having to restart my terminal (development of programs that froze usually) and it's a pain in the butt to constantly put in the sudo command and then my password. Is there a way I could through Python (or a script file) get an already sudo terminal?

I wasn't sure if I should post it on Stack Overflow (because of the coding side) or here (because of sudo/terminal stuff).

  • try "sudo su" then you're done typing sudo for a while; or if you absolutely have to, then run your python scripts from root. You know the dangers... I hope – root-11 Mar 18 '13 at 22:18
  • 1
    Thanks for the answer! I know the dangers and I know about sudo su/sudo -i but like I said in the question, I am constantly restarting the terminal window to apply changes/kill unresponsive programs. – RPiAwesomeness Mar 18 '13 at 22:22
  • 1
    have you tried ctrl + c when when something is unresponsive, superuser.com/questions/243460/… – Mateo Mar 18 '13 at 23:49
  • Just an FYI, no need to edit your title to say "Closed". When you choose an answer, it changes color accordingly on the main page. Which is why I rolled back the edit. – Thomas Ward Mar 19 '13 at 1:08

You should read this question, because running ANYTHING as root within a script or other piece of software that COULD be run without the administrator's knowledge is a very very dangerous and bad thing.

As well, running your system in a root terminal just to run a script is also equally dangerous.

(whether you know the security implications or not, question poster, others probably won't, hence this answer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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