Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-09-2007, 04:43 PM   #1
LQ Newbie
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0
Sudo Help Needed, Please


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!!

Old 11-09-2007, 05:05 PM   #2
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...
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...
Old 11-10-2007, 04:42 PM   #3
Registered: Nov 2007
Posts: 62

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

Rep: Reputation: 65
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:
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:
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, 08:15 AM   #5
LQ Newbie
Registered: Nov 2007
Posts: 2

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


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 02:36 AM
XGL needed for Beryl is conflicting with OpenGL needed for Cedega chunkeydelight Linux - Desktop 2 07-18-2007 06:50 AM
startup program: is sudo needed? Patrick K Ubuntu 2 04-24-2007 11:29 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
Sudo without having to type "sudo?" Mitch G Linux - Security 3 09-28-2006 03:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:42 AM.

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