add users to sudo file

Paul Sladen sounder at paul.sladen.org
Mon Nov 15 12:15:55 UTC 2004


On Mon, 15 Nov 2004, baza wrote:
> Hi, I've added a new user to my Linux box, but they can't run sudo, it
> reports they are not part of sudouser (something like that) file. When I
> had a look in /etc/sudoers it said you have to edit this from root with
> vi. Any advice before i go in? I don't want to hose my box.

Luckily, sudo comes with a special script that handles locking and syntax
checking of the 'sudoers' file after you've edited and will not save it
unless it's correct.  Try something like from an command terminal:

  EDITOR=gedit sudo visudo

and change the last line to read:

  baza,fred     ALL=(ALL) NOPASSWD: ALL

where baza and fred are the accounts that need to use sudo on 'ALL' machines
(sharing this config) to execute commands as 'ALL' users they want to, with
a password required for running 'ALL' commands.

After you've saved it, the script will either happily save it, or prompt you
to re-edit the file to correct it.

	-Paul
-- 
Is there no safe way to travel?  Edinburgh, GB






More information about the ubuntu-users mailing list