Monday, January 22, 2018

server - How can I run an autorun file as root with no gui

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.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...