Ho un pc desktop su cui ho creato 4 account a cui vorrei permettere lo spegnimento della macchina editando con visudo il file /etc/sudoers.
Dop aver consultato la [url]man-page http://www.sudo.ws/sudo/man/1.8.2/sudoers.man.html[/url] del comando ed alcuni esempi come questo http://www.openskill.info/infobox.php?ID=716 o quest'altro http://fox91.wordpress.com/2008/03/21/etcsudoers-con-una-marcia-in-piu/ ho editato il mio file come segue:
- Codice: Seleziona tutto
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
##
# Host alias specification
##
##
# User alias specification
##
User_Alias FAMIGLIA = miver, pippo, puto, paperino
##
# Cmnd alias specification
##
Cmd_Alias SPEGNIMENTO = /usr/sbin/shutdown -h now, /usr/bin/halt, /usr/bin/reboot
##
# Defaults specification
# Runas alias specification
# User privilege specification
##
root ALL=(ALL) ALL
##
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Tutti gli utenti appartenenti al gruppo OPERATORS possono lanciare i comandi relativi al gruppo SHUTDOWN senza l'uso di p
assword
##
FAMIGLIA ALL= NOPASSWD: SPEGNIMENTO
##
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now [code]
ricevendo il seguente messaggio d'errore nel cercare di editare il file salvandolo:
[code]Warning: undeclared Host_Alias `SPEGNIMENTO' referenced near line 20
Warning: undeclared Cmnd_Alias `SPEGNIMENTO' referenced near line 40
[/code]
Nel tentativo di spegnere la macchina con uno dei 4 utenti, inoltre, mi viene richiesta una password che non è ne quella di root ne quella dell'utente;
[code]miver@slackware:/etc$ su shutdown -h now
Password:
Come deve essere editato il file affinchè gli utenti esistenti (ed eventuali altri nuovi utenti) possono essere abilitati a spegnere la macchina senza la richiesta di password ed evitando di inserirli nel gruppo "wheel"?


.