Difference between revisions of "Allow users to shutdown (Italiano)"
Kynikos.bot (talk | contribs) (rm temporary i18n template) |
m (→Utilizzare sudo: aggiunto uno spazio alla configurazione di sudoers) |
||
Line 12: | Line 12: | ||
Ora, da root, vanno aggiunte delle righe alla fine di {{ic|/etc/sudoers}} usando {{Ic|visudo}}. Va sostituito {{Ic|'''user'''}} con il proprio username e {{Ic|'''hostname'''}} con l'hostname della macchina. | Ora, da root, vanno aggiunte delle righe alla fine di {{ic|/etc/sudoers}} usando {{Ic|visudo}}. Va sostituito {{Ic|'''user'''}} con il proprio username e {{Ic|'''hostname'''}} con l'hostname della macchina. | ||
− | '''user''' '''hostname'''=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot | + | '''user''' '''hostname''' =NOPASSWD: /sbin/shutdown -h now,/sbin/reboot |
Ora l'utente potrà spegnere il computer con {{Ic|sudo shutdown -h now}}, e riavviare con {{Ic|sudo reboot}}. Per spegnere il sistema si può anche usare {{Ic|poweroff}} oppure {{Ic|halt}}. | Ora l'utente potrà spegnere il computer con {{Ic|sudo shutdown -h now}}, e riavviare con {{Ic|sudo reboot}}. Per spegnere il sistema si può anche usare {{Ic|poweroff}} oppure {{Ic|halt}}. |
Revision as of 15:09, 14 September 2012
Utilizzare sudo
Prima di tutto va installato sudo
:
# pacman -S sudo
Ora, da root, vanno aggiunte delle righe alla fine di /etc/sudoers
usando visudo
. Va sostituito user
con il proprio username e hostname
con l'hostname della macchina.
user hostname =NOPASSWD: /sbin/shutdown -h now,/sbin/reboot
Ora l'utente potrà spegnere il computer con sudo shutdown -h now
, e riavviare con sudo reboot
. Per spegnere il sistema si può anche usare poweroff
oppure halt
.
Per comodità, è possibile aggiungere questi alias al proprio utente ~/.bashrc
(o a /etc/bash.bashrc
per una configurazione globale del sistema):
alias reboot="sudo reboot" alias poweroff="sudo poweroff" alias halt="sudo halt"
Utilizzare consolekit
Vedere ConsoleKit per maggiori informazioni.
Utilizzare acpid
acpid può essere utilizzato per consentire a chiunque abbia accesso fisico al computer di spegnere in maniera pulita il sistema utilizzando il pulsante di accensione.