Hallo Leute,
ich steh gerade voll auf dem Schlauch. Ich möchte das Sudo das Passwort des Users abfragt wenn es eingesetzt wird. Es sollen alle User aus der Gruppe "sudo" mit sudo Befehle ausführen dürfen, sollen dazu aber vorher ihr eigenes pw sagen.
# /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.
#
Defaults env_reset
# Host alias specification
# User alias specification
%sudo ALL=(ALL) PASSWD:ALL
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
Obwohl ich das PASSWD: hingeschrieben habe (Was eigentlich nicht notwenig sein sollte) will sudo kein Passwort wissen sondern gibt Rootbefehle sofort frei.
Normalerweise ist authenticate per Default gesetzt, wenn Deine Distribution dies weggepatched hat sollte folgende sudoers den Default wieder herstellen. In der letzten Zeile wird Deiner Gruppe sudo nach der Eingabe des jeweiligen Userpassworts voller Zugriff gewährt:
# 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
# Defaults specification
Defaults authenticate,env_reset
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Defaults env_reset, authenticate
# Host alias specification
# User alias specification
%sudo ALL=(ALL) ALL
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
und auch das hilft nicht. Irgendwas ist doch da total strange, gibt es irgendeine andere Einstellung die man drehen kann.
Unter Gentoo funktionierts gemäss manpage, also ohne explizites authenticate oder PASSWD:, daher hege ich fast den Verdacht, dass entweder Dein System oder Dein Distributionspaket broken ist. Um welche Distribution handelt es sich denn?
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
wie oben schon geschrieben, debian stable, ich habe sogar zwei server hier die beide das gleiche problem haben, beide mit debian stable. Dagegen hat mein Gentoo unstable keinerlei Probleme damit (Was deine Aussage ja noch bestätigt). Irgendwo muß der Hund doch begraben liegen, ich verstehs nicht!
So, nach einigem Suchen im Internet habe ich doch die Lösung gefunden:
So verlockend es auch sein mag die (bereits existierende) Gruppe "sudo" dafür zu verwenden was "wheel" bei Gentoo ist, also diejenige Gruppe in der alle sein sollen die sudo ausführen dürfen, es geht genau so schief: Es wird kein Passwort mehr abgefragt. Es ist sogar total egal was in der /etc/sudoers drinsteht, jeder der in der "sudo" gruppe bei debian mitglied ist darf sudo ohne passwort machen. Nach einem entfernen des users aus der gruppe und anlegen einer neuen gruppe ("wheel") funktioniert jetzt auch alles wie es sollte.
Man könnte das verhalten zumindest dokumentieren, hätte mir 3 Stunden erspart. :<
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
bahblup ALL=(ALL) ALL #User darf sudo ausführen
werde ich unter Debian stable auch nach dem Passwort gefragt - also IMHO nicht kaputt gepatcht.