LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2010, 05:37 AM   #1
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
Regarding sudoers file


Hi All,
How do I add a user in a sudoers file.
There is this specific command that I want to run and the error is as below.

Quote:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for ajit:
ajit is not in the sudoers file. This incident will be reported.

-A option not allowed for root!
and the command doesnt run.Can some one tell me what am i missing over here.

Regards!
Ajit
 
Old 10-04-2010, 05:55 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
[sudo] password for ajit:
ajit is not in the sudoers file. This incident will be reported.
I guess it's what the message says.

If you don't have permission to modify the sudoers file, you can't modify it anyway.
 
Old 10-04-2010, 06:00 AM   #3
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Original Poster
Rep: Reputation: 21
:newbie:

I want to know how to modify the file.I am running hte command using the root login.
 
Old 10-04-2010, 06:03 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
hi you need to login as root

using

Quote:
su -
Then as root open file

Quote:
visudo
Add the line given below
Quote:
ajit ALL=(ALL) NOPASSWD: ALL
Once you are added as sudoer Logout from root terminal

and as ajit user do this

Quote:
sudo <root-privileges-command>

Last edited by prayag_pjs; 10-04-2010 at 06:04 AM.
 
1 members found this post helpful.
Old 10-04-2010, 06:08 AM   #5
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by Ajit Gunge View Post
There is this specific command that I want to run and the error is as below.
open /etc/sudoers file as root and add give specific command's privilege to user ajit.

vi /etc/sudoers

Code:
ajit ALL = (ALL) /full/path/of/command
Regards,
 
Old 10-04-2010, 10:44 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by sem007 View Post
vi /etc/sudoers
Better to use visudo instead of vi; from the man page

Code:
visudo edits the sudoers file in a safe fashion, analogous to vipw(8).
visudo locks the sudoers file against multiple simultaneous edits, pro‐
vides basic sanity checks, and checks for parse errors.  If the sudoers
file is currently being edited you will receive a message to try again
later.
 
Old 10-05-2010, 01:38 AM   #7
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
in future you can avoid this by giving the new user you create admin privileges or adding him to the "root" group.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with sudoers file blancs Linux - Newbie 4 07-25-2008 06:42 PM
not in the sudoers file? underworld288 Slackware 3 06-18-2007 01:48 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 06:03 PM
sudoers file cactus-bob Linux - Newbie 2 03-11-2004 12:24 PM
help with sudoers file ogden2k Linux - Security 4 03-11-2003 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration