schneevater
15.06.02, 21:10
Hallo,
es geht mal wieder um sudo. Und zwar habe ich folgendes Problem.
Ich möchte das mein User den Befehle "shutdown -h now" ausführen kann.
sudoers sieht folgendermasen aus:
# 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 USER=schneevater
# Cmnd alias specification
Cmnd_Alias BOOT=/sbin/shutdown -h now
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
USER ALL=NOPASSWD:BOOT
# 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
Wenn ich nun z.B. von /home/schneevater aus "sudo shutdown -h now" eingebe, werde ich das erstemal nach einem Passwort gefragt. Nachdem ich das Passwort eingegeben habe, bekomme ich die Meldung das sudo den Befehl shutdown (ohne -h now) nicht finden kann. Wechsel ich nach /sbin und gebe dort "sudo shutdown -h now" ein bzw. aus irgendeinem anderen Verzeichnis "sudo /sbin/shutdown -h now" funktioniert es einwandfrei.
Ich habe es mal mit anderen Befehlen versucht, hat aber auch nichts gebracht.
Was habe ich falsch gemacht??????????? Oder ist das richtig, das ich den kompletten Pfad eingeben muß??
es geht mal wieder um sudo. Und zwar habe ich folgendes Problem.
Ich möchte das mein User den Befehle "shutdown -h now" ausführen kann.
sudoers sieht folgendermasen aus:
# 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 USER=schneevater
# Cmnd alias specification
Cmnd_Alias BOOT=/sbin/shutdown -h now
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
USER ALL=NOPASSWD:BOOT
# 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
Wenn ich nun z.B. von /home/schneevater aus "sudo shutdown -h now" eingebe, werde ich das erstemal nach einem Passwort gefragt. Nachdem ich das Passwort eingegeben habe, bekomme ich die Meldung das sudo den Befehl shutdown (ohne -h now) nicht finden kann. Wechsel ich nach /sbin und gebe dort "sudo shutdown -h now" ein bzw. aus irgendeinem anderen Verzeichnis "sudo /sbin/shutdown -h now" funktioniert es einwandfrei.
Ich habe es mal mit anderen Befehlen versucht, hat aber auch nichts gebracht.
Was habe ich falsch gemacht??????????? Oder ist das richtig, das ich den kompletten Pfad eingeben muß??