Su Debian come faccio a spegnere il sistema senza dover inserire ogni volta la password di root?
Su Debian come faccio a spegnere il sistema senza dover inserire ogni volta la password di root?
Ubuntu 10.10 x86_64
Modifichi /etc/inittab da così:
a così:codice:ca::ctrlaltdel:/sbin/shutdown -t3 -r nowDevi riavviare il computer perchè funzioni.codice:ca::ctrlaltdel:/sbin/shutdown -h now
Utilizzi sudo.
Editi sudoers con visudo aggiungendo queste due righe:
dopodichè senza loggarti come rootcodice:Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot nomeutente nomeutente = SHUTDOWN,NOPASSWD: ALL
codice:$ sudo halt
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
Ditemi dove sbaglio:
su
inserisco pwd root
visudo -f sudoers
# /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.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot
max max = SHUTDOWN,NOPASSWD: ALL
tolgo pwd root
sudo halt
max is not allowed to run sudo on themax. This incident will be reported.
Ubuntu 10.10 x86_64
max max = SHUTDOWN,NOPASSWD: ALL
deve essere
max themax = SHUTDOWN,NOPASSWD: ALL
se la tua macchina si chiama themax
Ci sono cose che non si possono sapere. Per tutto il resto c'è man
Prima di fare domande stupide: 1) googla 2) leggi le manpages 3) sparati.
Ok, grazie, però quando devo spegnere mi chiede comunque la password.
Ubuntu 10.10 x86_64
Prova a mettere questa rigaprima di questacodice:Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot
Segui i commenti:codice:root ALL=(ALL) ALL
E scusa per l'errore di primacodice:# Cmnd alias specification Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot # User privilege specification root ALL=(ALL) ALL max hostname = SHUTDOWN,NOPASSWD: ALL
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
Non so cosa possa essere ma me la chiede ancora....
Boh
Ubuntu 10.10 x86_64
non è la soluzione + adeguata, perchè se si riesce è meglio non utilizzarla, ma puoi anche spegnere il pc da utente dando lo sticky bit al comando halt.
Da utente root digita:
chmod +s /sbin/halt
Se riesci però studiati meglio sudo e il file di conf.
Ciao
E il consiglio di maiosyet_2? Si può utilizzare?Originariamente inviato da gianiaz
non è la soluzione + adeguata, perchè se si riesce è meglio non utilizzarla, ma puoi anche spegnere il pc da utente dando lo sticky bit al comando halt.
Da utente root digita:
chmod +s /sbin/halt
Se riesci però studiati meglio sudo e il file di conf.
Ciao