LinuxQuestions.org
Help answer threads with 0 replies.
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 11-09-2007, 03:43 PM   #1
eshaaf
LQ Newbie
 
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0
Sudo Help Needed, Please


Hello,

I am new to the Linux world and I need help setting up the sudoers file to allow a user to perform root commands using sudo (ex. "sudo chown root file.txt").

Does anyone know how I would setup the file to allow this?

Your help is greatly appreciated!!

Thanks!
 
Old 11-09-2007, 04:05 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
Add a line with the following info...
Code:
username localhost=command1, command2, command3
This will allow username to run the listed commands, and only those listed commands, with sudo, and only on the localhost.

You can read all about the wonderful world of sudoers at...
http://www.gratisoft.us/sudo/man/sudoers.html
 
Old 11-10-2007, 03:42 PM   #3
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Rep: Reputation: 15
type visudo
 
Old 11-10-2007, 03:56 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
The visudo command may be typed into a terminal window, and should be used to edit the configuration file, rather than editing the file directly. If you would like to use a different editor from the one which visudo gives you, you can set the VISUAL environment variable when you run it. In the examples below I set the editor to "nano", which is a nice simple little editor.

If you are using a distribution where you have a root account, and are using it, just use this command:
Code:
VISUAL=nano visudo
On systems like Ubuntu, where the root account is not available for logging in to, and admin commands are performed using sudo itself, you can do it like this:
Code:
VISUAL=nano sudo visudo
You don't have to explicitly set your VISUAL variable - if you don't some default will be used. I mention it just because the default is often vi, and if you have never used it before it can be very confusing.
 
Old 11-11-2007, 07:15 AM   #5
eshaaf
LQ Newbie
 
Registered: Nov 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you Ranger Nemo!
 
  


Reply

Tags
commands, sudo, sudoers


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
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
XGL needed for Beryl is conflicting with OpenGL needed for Cedega chunkeydelight Linux - Desktop 2 07-18-2007 05:50 AM
startup program: is sudo needed? Patrick K Ubuntu 2 04-24-2007 10:29 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Sudo without having to type "sudo?" Mitch G Linux - Security 3 09-28-2006 02:16 PM


All times are GMT -5. The time now is 05:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration