Skript ausführen wie als root eingelogt
Hallo Leute! Weiss eine(r) von Euch, wie ich ein Skript zu schreiben habe, dessen Inhalt komplett so ausgeführt wird, als ob wäre root eingelogt? Ich meine, wenn ich einem Skript chmod 4755 und chown root:root gebe, dann wird es als ein Prozess ausgeführt, das root gehört, so weit so gut. Wenn ich in diesem Skript aber z.B. ein su auf ein anderes Konto machen möchte, fragt mich das Skript nach dem zugehörigen Passwort, was ja nicht passiert wenn ich root bin. Was muss ich im Skript reinschreiben, damit z.B. das ohne Passwortabfrage klappt? Danke! --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
Jose Luis Tinoco (Tinoco@student.physik.uni-dortmund.de) schrieb:
Weiss eine(r) von Euch, wie ich ein Skript zu schreiben habe, dessen Inhalt komplett so ausgeführt wird, als ob wäre root eingelogt? Ich meine, wenn ich einem Skript chmod 4755 und chown root:root gebe, dann wird es als ein Prozess ausgeführt, das root gehört, so weit so gut. Wenn ich in diesem Skript aber z.B. ein su auf ein anderes Konto machen möchte, fragt mich das Skript nach dem zugehörigen Passwort, was ja nicht passiert wenn ich root bin. Was muss ich im Skript reinschreiben, damit z.B. das ohne Passwortabfrage klappt?
nicht su sondern su1 nehmen, in der su1.priv entsprechende einträge vornehmen und es geht, wenn ich dich richtig verstanden hab. gruß johannes -- ----------------------------------------- Johannes Huettemeister |"Bobby, weisst du, was eine Metapher ist?" j.huettemeister@t-online.de|"Eine Komponente? Wie'n Kondensator?" (L)icq: 33949822 | - Count Zero --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
Johannes Huettemeister wrote:
Jose Luis Tinoco (Tinoco@student.physik.uni-dortmund.de) schrieb:
Weiss eine(r) von Euch, wie ich ein Skript zu schreiben habe, dessen Inhalt komplett so ausgeführt wird, als ob wäre root eingelogt? Ich meine, wenn ich einem Skript chmod 4755 und chown root:root gebe, dann wird es als ein Prozess ausgeführt, das root gehört, so weit so gut. Wenn ich in diesem Skript aber z.B. ein su auf ein anderes Konto machen möchte, fragt mich das Skript nach dem zugehörigen Passwort, was ja nicht passiert wenn ich root bin. Was muss ich im Skript reinschreiben, damit z.B. das ohne Passwortabfrage klappt?
nicht su sondern su1 nehmen, in der su1.priv entsprechende einträge vornehmen und es geht, wenn ich dich richtig verstanden hab.
gruß johannes
Vielen Dank! Das gewünschte Skript müssen aber all meine Benutzer ausführen können, ich wollte mir die Arbeit erparen, eine weitere Datenbank pflegen zu müssen. Gibt es da vielleicht was anderes, wo man mit weniger Aufwand das selbe erreichen kann? Kann man z.B. vielleicht mit irgend einem Befehl die uid und gid umsetzen? Bisher habe ich nur C-Prozeduren gefunden, mit denen kann ich mein Skript ja immerhin schreiben, ein Skript wäre aber schöner. Hat jemand eine Ahnung? JLT --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
* Jose Luis Tinoco schrieb am 06.Jun.2000:
Weiss eine(r) von Euch, wie ich ein Skript zu schreiben habe, dessen Inhalt komplett so ausgeführt wird, als ob wäre root eingelogt? Ich meine, wenn ich einem Skript chmod 4755 und chown root:root gebe, dann wird es als ein Prozess ausgeführt, das root gehört, so weit so gut. Wenn ich in diesem Skript aber z.B. ein su auf ein anderes Konto machen möchte, fragt mich das Skript nach dem zugehörigen Passwort, was ja nicht passiert wenn ich root bin. Was muss ich im Skript reinschreiben, damit z.B. das ohne Passwortabfrage klappt?
Das SUID-Bit hat auf Skripte keine Auswirkungen. Du muß schon entweder ein C-Programm schreiben, oder aber sudo bzw. su1 benutzen. Bernd -- Hast Du bei Problemen schon in der SuSE-Support-Datenbank (SDB) nachgesehen? Auf Deinem Rechner: file://usr/doc/susehilf/index.html | mit Apache: http://localhost/doc/susehilf/index.html | Zufalls- Tagesaktuell bei SuSE: http://sdb.suse.de/sdb/de/html/index.html | signatur 2 --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
Bernd Brodesser wrote:
Das SUID-Bit hat auf Skripte keine Auswirkungen. Du muß schon entweder ein C-Programm schreiben, oder aber sudo bzw. su1 benutzen.
Aaaahhaaaaaaa!!!!!! Da haben wirs! Ich machs dann mit su1, man kann in der /etc/su1.priv auch mit Wildkarten arbeiten, sehr schön. Vielen Dank Bernd & Johannes! --------------------------------------------------------------------- To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com For additional commands, e-mail: suse-linux-help@suse.com
participants (3)
-
B.Brodesser@online-club.de
-
j.huettemeister@t-online.de
-
Tinoco@student.physik.uni-dortmund.de