Find the answer to your Linux question:
Results 1 to 4 of 4
I'm running SuseLinux10 (mostly like OpenSuse I think) I have a script from which I need to call another script where the second script runs as a more privileged user ...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2

    Can't get sudoer to work right

    I'm running SuseLinux10 (mostly like OpenSuse I think)

    I have a script from which I need to call another script where the second script runs as a more privileged user (though not root) than the original user. The line is the script is:

    /bin/su - priv_user -c "${classbin}/pcnew ${1} ${LOGNAME}"

    Classbin could be absolute, but the args really need to remain variable.

    Is this possible to set this up in the sudoer file so that the unprivileged user doesn't have to enter the password of the privileged user? I attempted it as best I understood the sudoer file, but it didn't work (still asks for a password in other words). Here's the important lines from my sudoer file:

    Cmnd_Alias PC1240 = /bin/su - priv_user -c "${classbin}/pcnew ${1} ${LOGNAME}"

    %1240 ALL=(ALL) NOPASSWD: PC1240

    Thanks.

  2. #2
    Linux Newbie tiersen's Avatar
    Join Date
    May 2008
    Location
    Tokyo,Japan
    Posts
    226
    echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers

    where loginname is your user account. If you don't want to be prompted a password use 'ALL=(ALL) NOPASSWD:ALL'
    "If we lived in a world where the better technology won out, then no doubt everybody and their aunt Fanny would be using GNU/Linux"
    Sam Varghese

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2
    wouldn't that let them run any program in the universe? I want to limit them to a particular program (a shell script actually)

  4. #4
    Linux Newbie tiersen's Avatar
    Join Date
    May 2008
    Location
    Tokyo,Japan
    Posts
    226
    You're right. Sorry, I misunderstood
    "If we lived in a world where the better technology won out, then no doubt everybody and their aunt Fanny would be using GNU/Linux"
    Sam Varghese

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...