Jump to content

running a script as root


Recommended Posts

Hi,

i wrote a pptp connection script for my friend but we need to run it as root

how can i set in the mandriva that everytime that a user will log in the script will run as root ?

 

i tried using the kdesu command but how do i make it open a shell window and run something ?

 

thanks

Link to comment
Share on other sites

how can i set in the mandriva that everytime that a user will log in the script will run as root ?

i tried using the kdesu command but how do i make it open a shell window and run something ?

thanks

Did you even try the forum search?

 

With the words "autostart script" I managed to find a list where the below topic was fourth from the top...

https://mandrivausers.org/index.php?showtopic=43340

Edited by dude67
Link to comment
Share on other sites

Assuming that you want the script "foo" being run after the user "user1" login, put it at a system path e.g. /bin, add it to the user's ~.bashrc and then (if the script includes commands which need root access) run "visudo" and add a line:

%user1 ALL=/bin/foo

Notice that this will give root access to that script for all members of the group "user1"

Now, save and exit ( :wq using vim ) and the script will run next time the user logs in.

If you wish this script being run by many users, not just "user1" and the members of the "user1" group, put it in /etc/rc.local instead

Edited by scarecrow
Link to comment
Share on other sites

Did you even try the forum search?

 

yes i tried to search the forum, and i found what you pointed but i ask something different (maybe i didn't explain myself very well :unsure: )

i want to start at start up a console window and then in it run a script automatically.

 

thanks,

noluck :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...