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 set up a server using ubuntu with no gui. I need root for some tasks that I want to autorun on this server. Normally I would just use gksudo because autorun programs never seem to work with su or sudo. gksudo will not run because there is no gui on this server. I decided to install xubuntu-desktop on it but this slows it significantly. What is a way that i can run an autorun file as root without any need for a gui?

By autorun I mean I want to create a sh script that will startup on login. I want it to have root privelages and sh scripts dont work with sudo because they run all the code as the sudo password.

share|improve this question
3  
what do you mean by autorun? –  Thomas Mar 11 '13 at 18:58

1 Answer 1

Possible solutions based on the definition of 'autorun':

  1. Windows 'autorun.ini' files places in media root directories such as CDs or USB sticks. DO NOT RUN AS ROOT, EVER.
  2. Programs run when a user logs in: Running a script after the gui has loaded
  3. Programs run when the computer starts: How to run a script in boot as root
share|improve this answer

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.