Results 1 to 10 of 25

Thread: Giving a single script root with out a password

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Location
    Alsip, IL
    Beans
    2,027
    Distro
    Ubuntu 10.04 Lucid Lynx

    Giving a single script root with out a password

    I have a script I have to run to make my 3g modem work how ever it needs root privileges to run properly. Is there a way I can allow this script to run in root with out prompting the user to give a password? I have people that use my netbook who need to turn on the 3g but who don't need my root password.

    ~Jeff

  2. #2
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,543

    Re: Giving a single script root with out a password

    sudo visudo

    add:
    %users ALL=(ALL) NOPASSWD: /path/to/script

    you still have to use sudo, but it won't ask for a password.
    example:
    sudo script

  3. #3
    Join Date
    Jun 2005
    Beans
    6,115

    Re: Giving a single script root with out a password

    Just remind the dangers of doing this, there is nothing more dangerous then passwordless systems.
    HOME BUILT SYSTEM! http://brainstorm.ubuntu.com/idea/22804/ Please vote up!
    remember kiddies: sudo rm -rf= BAD!, if someone tells you to do this, please ignore them unless YOU WANT YOUR SYSTEM WIPED

  4. #4
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,543

    Re: Giving a single script root with out a password

    Quote Originally Posted by SunnyRabbiera View Post
    Just remind the dangers of doing this, there is nothing more dangerous then passwordless systems.
    he said script, not system, he does not want to share the password.

  5. #5
    Join Date
    Jul 2007
    Location
    Alsip, IL
    Beans
    2,027
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Giving a single script root with out a password

    Thank you much Kerry, worked like a charm.

    ~Jeff

  6. #6
    Join Date
    Jul 2007
    Location
    Alsip, IL
    Beans
    2,027
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Giving a single script root with out a password

    It looks like I spoke too soon... Here is my sudo visudo file:

    Code:
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    %user ALL=(ALL) NOPASSWD: /home/jeff/.flipflop.sh
    And here is my command I am running:

    Code:
    sudo /home/jeff/.flipflop.sh
    How ever when it pops up a terminal to run the script it still asks me to enter a root password :/ Any ideas what I am doing wrong?

    Thanks,
    ~Jeff

Bookmarks

Posting Permissions

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