Jump to content

running a script as root


Recommended Posts

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...