[Chester LUG] visudo is driving me round the twist

Roger Downing roger.downing at stfc.ac.uk
Fri Oct 24 08:27:03 UTC 2008


On Thursday 23 October 2008 22:39:37 Stuart Burns wrote:
> Hi everyone,
> 
> Hopefully a quickish question.
> 
> I'm trying to set up sudoer file but failing badly.
> 
> I am running suse SLES 10.2 but hitting a problem.
> 
> I have a user called adam ;) that I want to allow to run the sudo command,
> via the sudoer file....
> 
> However trying to make it work, fails miserably.
> 
> Can anyone who has 5 mins post a proper sudoer file ?
> 
> Regards
> 
> Stuart.
> 
The most basic rule, which would allow a named user to run any command as root, would be:
adam	ALL=(ALL) ALL

This permits user adam, logged in at any host (this allows for shared sudoers files across many machines), to run any command as any user.

Are you using the 'visudo' command to do the editing of the /etc/sudoers file? This will validate the file each time.

As requested, here is a working but basic one straight from ubuntu 8.04:
--- SNIP ---

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults

Defaults        !lecture,tty_tickets,!fqdn

# User privilege specification
root    ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

--- SNIP ---

-- 
Roger Downing
SRB Systems Manager
STFC
Daresbury Laboratories
Keckwick Lane
Warrington
WA4 4AD

Tel: 01925 603937
Mbl: 07880 736154




More information about the Chester mailing list