Il comando visudo viene utilizzato per editare i permessi utente per l’esecuzione con privilegi amministrativi di determinati programmi / script.
Questo un file tipico, dopo una installazione di Ubuntu 10.04.3 LTS
# /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. # Defaults env_reset # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL # Allow members of group sudo to execute any command after they have # provided their password # (Note that later entries override this, so you might need to move # it further down) %sudo ALL=(ALL) ALL # #includedir /etc/sudoers.d # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL
Per aggiungere per esempio che l’utente nagios abbia accesso come root a uno script sh e senza richiede password,
si può utilizzare la seguente sintassi:
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins
Attenzione: inserire il comando alla fine del file, altrimenti non ha effetto.
Per salvare il file:
Ctrl+X
Yes
Invio
Per maggiori informazioni:
http://linuxmx.it/guide/generiche/129-conoscere-sudo-e-il-file-sudoers.html