Re: Programm mit sudo|gksu als anderer User ausführen, ohne Passwort
Hallo,
Frank Dietrich wrote:
> ich möchte gern ein Programm mittels sudo|gksu, ohne Passwortabfrage,
> als User user2 ausführen.
> Wie bekomme ich die Passwortabfrage weg?
Ich habe das nach einigem Herumprobieren jetzt so hinbekommen, das
dürfte aber wohl noch eleganter gehen. Trick ist, das Ganze in zwei Skripte
aufzuteilen:
/tmp/myscript1.sh:
/---------------
| #!/bin/sh
|
| xauth nextract /tmp/cookie.file $DISPLAY
| chmod 644 /tmp/cookie.file
| sudo -i -u user2 /tmp/myscript.sh
\---------------
/tmp/myscript.sh:
/---------------
| #!/bin/sh
|
| export DISPLAY=:0.0
| export XAUTHORITY=~/.Xauthority
| xauth nmerge /tmp/cookie.file
| firefox
\---------------
/etc/sodoers:
/---------------
| wolf ALL=(user2) NOPASSWD: /bin/bash /tmp/myscript.sh
\---------------
hth, Wolf
--
Just checking some mail filters: wodim cdrecord cdrkit cdrtools
Reply to: