2

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).

Thomas Ward
  • 74,764
  • 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, http://superuser.com/questions/243460/what-to-do-when-ctrl-c-cant-kill-a-process – 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 01:08

1 Answers1

3

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)

Thomas Ward
  • 74,764