Announcement

Collapse
No announcement yet.

Autorun script as root?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Autorun script as root?

    I want to autorun a script when I insert my USB-drive and I have successfully done that, only one problem... I want it to run as root automatically, without a popup asking me for the password. How can I do this?

    #2
    Re: Autorun script as root?

    the proper way to do this would probably be to add some
    directive in the /etc/sudoers (see "man sudoers") file
    to exempt that specific command from asking the password.

    another way is to have your script belong to root:root
    and set the "set user id" bit to the permission mask.
    this probably raises some security issues, but
    Code:
    chown root:root <path_to_your_script>
    chmod 750 <path_to_your_script>
    chmod u+s <path_to_your_script>
    maybe someone has a better idea...
    this is what crops up to my mind at this time at night...
    gnu/linux is not windoze

    Comment


      #3
      Re: Autorun script as root?

      The security issues are about the same for either method.

      What's the goal of the script, by the way? (I ask because there might be a safer way to do it.)
      For external use only.

      Comment


        #4
        Re: Autorun script as root?

        What the script does is mount two truecrypt encrypted drives. Right now the script is on my hard drive, but I would also like it to be on the USB-drive, so when I insert my USB-memory it acts like a key and the script on the USB-memory is executed after the USB-memory is mounted. Can I do this?

        Comment

        Working...
        X