Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
    
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 –  BHM 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. –  RPi Awesomeness 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 W. Mar 19 '13 at 1:08
add comment

1 Answer 1

up vote 3 down vote accepted

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)

share|improve this answer
    
Thank you. Yes, you're right, having a script like that could be a major system danger and I will forget all of this. Finger pushups, here I come! :D –  RPi Awesomeness Mar 19 '13 at 0:16
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.