Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 18
  1. #1
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712

    Debian - arresto sistema senza permessi root

    Su Debian come faccio a spegnere il sistema senza dover inserire ogni volta la password di root?
    Ubuntu 10.10 x86_64

  2. #2
    Modifichi /etc/inittab da così:
    codice:
    ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    a così:
    codice:
    ca::ctrlaltdel:/sbin/shutdown -h now
    Devi riavviare il computer perchè funzioni.

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,202
    Utilizzi sudo.

    Editi sudoers con visudo aggiungendo queste due righe:
    codice:
    Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot
    nomeutente     nomeutente = SHUTDOWN,NOPASSWD: ALL
    dopodichè senza loggarti come root
    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

  4. #4
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    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

  5. #5
    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.

  6. #6
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    Ok, grazie, però quando devo spegnere mi chiede comunque la password.
    Ubuntu 10.10 x86_64

  7. #7
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,202
    Prova a mettere questa riga
    codice:
    Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot
    prima di questa
    codice:
    root ALL=(ALL) ALL
    Segui i commenti:

    codice:
    # Cmnd alias specification
    Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown,/sbin/reboot
    
    # User privilege specification
    root ALL=(ALL) ALL
    max hostname = SHUTDOWN,NOPASSWD: ALL
    E scusa per l'errore di prima
    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

  8. #8
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    Non so cosa possa essere ma me la chiede ancora....
    Boh
    Ubuntu 10.10 x86_64

  9. #9
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    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

  10. #10
    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
    E il consiglio di maiosyet_2? Si può utilizzare?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.