LinuxQuestions.org
Review your favorite Linux distribution.
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 03-06-2008, 07:33 PM   #1
aapanju
LQ Newbie
 
Registered: Mar 2008
Posts: 26

Rep: Reputation: 15
Editing Sudoers File...


I would like to know how to edit the sudoers file. i know i have to use visudo .
i want give the user ali permission to run fdisk and sshd... i dont know the syntax to use .. running fedora core 8.
 
Old 03-06-2008, 07:40 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by aapanju View Post
I would like to know how to edit the sudoers file. i know i have to use visudo .
i want give the user ali permission to run fdisk and sshd... i dont know the syntax to use .. running fedora core 8.
Something like this...

Code:
ali     ALL=/sbin/fdisk,/usr/sbin/sshd
Take a look at this

http://www.ota.be/linux/workshops/19981017/sudo.html

Also you can find information using this
http://www.google.com/linux
 
Old 03-06-2008, 07:41 PM   #3
aapanju
LQ Newbie
 
Registered: Mar 2008
Posts: 26

Original Poster
Rep: Reputation: 15
do i just type visudo and edit that? or is there sumthing else involved?
 
Old 03-06-2008, 07:43 PM   #4
aapanju
LQ Newbie
 
Registered: Mar 2008
Posts: 26

Original Poster
Rep: Reputation: 15
i did this .. but it doesnt seem to work ..
ali ALL=NOPASSWD: /sbin/fdisk; /usr/sbin/sshd
 
Old 03-06-2008, 07:45 PM   #5
aapanju
LQ Newbie
 
Registered: Mar 2008
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks bro your command was correct. It worked.
 
Old 03-06-2008, 07:45 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by aapanju View Post
do i just type visudo and edit that? or is there sumthing else involved?
yes visudo...

Or if you are not used to using the command line; you can use gedit...

Code:
gedit /etc/sudoers
But I would recommend using visudo.
 
Old 03-06-2008, 07:52 PM   #7
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Or before executing the visudo command set the edit of choice.
export EDITOR=gedit

Now issue visudo command and it uses gedit or whatever you perfer. Then on exit it still confirms sudoers file is in correct syntax structure. that is the main purpose of visudo command.

Brian
 
Old 03-06-2008, 10:10 PM   #8
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by Brian1 View Post
Or before executing the visudo command set the edit of choice.
export EDITOR=gedit

Now issue visudo command and it uses gedit or whatever you perfer. Then on exit it still confirms sudoers file is in correct syntax structure. that is the main purpose of visudo command.

Brian
This is a better practice than what I suggested above.

Thanks Brian

-C

Last edited by custangro; 03-06-2008 at 10:13 PM.
 
  


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
Editing sudoers (shows as new file in nano) rushinblue Linux - Newbie 2 11-06-2007 02:17 PM
/etc/sudoers, editing mickeyboa Fedora 2 07-26-2007 07:31 PM
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
Help editing /etc/sudoers amer_58 Linux - Newbie 3 07-22-2005 04:17 AM
Help Editing Sudoers File Rubicone Linux - Newbie 2 05-03-2002 02:50 AM

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

All times are GMT -5. The time now is 07:32 PM.

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