Pagina 1 di 1

/etc/sudoers

Inviato: mar 28 mar 2006, 9:39
da Almucantarat
Sto cercando di configurare bene il file /etc/sudoers.

Questo è quello che ho attualmente:

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

# Cmnd alias specification
Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown
Cmnd_Alias NTPDATE=/usr/sbin/ntpdate ntp1.ien.it
# Defaults specification

# Runas alias specification
amir amirlinux=SHUTDOWN,NTPDATE,NOPASSWD: ALL

# 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

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now
non mi chiede la password per nulla mentre io vorrei che NON chiedesse la password SOLO per shutdown e ntpdate mentre per il resto si

dove ho sbagliato?

Inviato: mar 28 mar 2006, 10:00
da manublade
amir amirlinux=SHUTDOWN,NTPDATE,NOPASSWD: ALL
Hai dato l'opzione no password per entrambi gli alias ed inoltre un ALL che può essere pericoloso. Prova

Codice: Seleziona tutto

 
amir amirlinux = NOPASSWD: SHUTDOWN, NTPDATE 


Inviato: mar 28 mar 2006, 10:13
da MAT
Non dovrebbe essere così?

Codice: Seleziona tutto

amir amirlinux = NOPASSWD: $SHUTDOWN, $NTPDATE 

Inviato: mar 28 mar 2006, 11:07
da manublade
No Mat.

Inviato: mar 28 mar 2006, 13:25
da MAT
Ah ok, chiedevo. nel mio /etc/sudoers scrivo il percorso dei comandi senza usare variabili intermedie.

Inviato: mar 28 mar 2006, 19:51
da Almucantarat
grazie!