Find the answer to your Linux question:
Results 1 to 9 of 9
whenever i try to install an application it requires root auth. for example i try to install mysql like following Code: sudo yum install mysql it gives following warnin after ...
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    27

    [SOLVED] is not in the sudoers file. This incident will be reported.

    whenever i try to install an application it requires root auth. for example i try to install mysql like following

    Code:
    sudo yum install mysql
    it gives following warnin after root pass
    Code:
     zodehala is not in the sudoers file.  This incident will be reported
    in order to add zodehala into sudoers file i gives following command
    Code:
    sudo gedit /etc/sudoers
    it gives following warning after root pass
    Code:
     zodehala is not in the sudoers file.  This incident will be reported
    is it a paradox ? or what ?

  2. #2
    Linux User glennzo's Avatar
    Join Date
    Sep 2004
    Location
    Salem, Mass
    Posts
    434
    You don't edit the sudoers file directly. Log in as root (terminal) and type the following:
    Code:
    echo 'zodehala ALL=(ALL) ALL' >> /etc/sudoers
    From now on you can use sudo as user zodehala.
    Glenn
    Powered by Fedora 16 and Arch Linux

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    You don't edit the sudoers file directly. Log in as root (terminal) and type the following:
    Is that so? I always edit it directly using visudo. visudo - Wikipedia, the free encyclopedia

    Some distros, like Ubuntu, set up the first user created with sudo priveleges automatically, others, like Fedora, set up a root password, but your user doesn't have sudo priveleges. You can set your user up, but you need to "su" to root to do so.

  4. #4
    Just Joined!
    Join Date
    Sep 2007
    Location
    Lafayette, IN
    Posts
    83
    I'd feel more comfortable using visudo than echoing to sudoers. visudo does some syntax checking before it writes /etc/sudoers, allowing you to catch (most) mistakes without breaking things. Plus, echoing leaves you open to only including one bracket, which would overwrite your existing file.

    Also, if you don't like vi, you can change the EDITOR environment variable to whatever you want. For example:

    Code:
    [521 root@devo ~ ]$ EDITOR=nano visudo
    Last edited by Ben Cotton; 04-09-2009 at 12:28 AM. Reason: adding more info

  5. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    I agree with glennzo.
    If I am sure that the command I am going to add in sudoer file is correct then I prefer echo instead of editing file. Its really simple and easy way to add contents in file.
    Code:
    su -
    echo 'zodehala ALL=(ALL) ALL' >> /etc/sudoers
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #6
    Just Joined!
    Join Date
    Jan 2007
    Posts
    27

  7. #7
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Quote Originally Posted by devils casper View Post
    I prefer echo instead of editing file. Its really simple and easy way to add contents in file.
    Code:
    su -
    echo 'zodehala ALL=(ALL) ALL' >> /etc/sudoers
    As long as you get the redirect right! I'd hate to see someone use overwrite > instead of append >>

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by bigtomrodney View Post
    As long as you get the redirect right! I'd hate to see someone use overwrite > instead of append >>
    Yes. That can definitely lead to one of those memorable "Oh, ****!" moments we all experience from time to time...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Nov 2005
    Location
    UK
    Posts
    19
    Good post, help me, and I like that is easy to do it....

    Thanks,

Posting Permissions

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