You edit the /etc/sudoers file by using the visudo command which performs some error checking on the file. The visudo command uses the default editor in the Debian alternatives system. To change which editor is the default, use the update-alternatives --config editor command and select your preferred editor.
To setup sudo add one or more of the following code examples to that file and save it.
if you want to give sudo power for one specific command to one specific user
Code: Select all
user ALL= /usr/sbin/command
if you want to give sudo power for one specific command with no password requirement to one specific user on the system
Code: Select all
user ALL= NOPASSWD: /usr/sbin/command
if you want to give sudo power for all commands to one specific user
Code: Select all
user ALL=(ALL) ALL
if you want to give sudo power for all commands with no password requirement to one specific user
Code: Select all
user ALL=(ALL) NOPASSWD: ALL
if you want to give sudo power for all commands to all users on the system
Code: Select all
ALL ALL=(ALL) ALL
if you want to give sudo power for all commands with no password requirement to all users on the system
Code: Select all
ALL ALL=(ALL) NOPASSWD: ALL
if you want to give sudo power for one specific command to a group on the system
Code: Select all
%group ALL = /usr/sbin/command
if you want to give sudo power with no password requirement for one specific command to a group on the system
Code: Select all
%group ALL = NOPASSWD: /usr/sbin/command
if you want to give sudo power for all commands to a group on the system
Code: Select all
%group ALL = (ALL) ALL
if you want to give sudo power for all commands with no password requirement to a group on the system
Code: Select all
%group ALL = (ALL) NOPASSWD: ALL
for even more examples see the next post