sudo and X




There has been some discussion about sudo and X, but I have yet to
see a solution.

The problem is, with the latest update to sudo, when I try to use sudo
to run a program that opens a window (example: sudo xterm) I get
the error:

xterm: DISPLAY is not set

So I wrote the following script:

#!/bin/bash
echo DISPLAY is $DISPLAY


When I run it using sudo before the sudo update, the output is:

DISPLAY is localhost:11.0

when I run it using sudo after the update, I get:

DISPLAY is


Can I do something to force sudo to set the DISPLAY variable? I've seen
the suggested solution to use sux, but with sux, the user has to know the
root password, right?

Any help would be appreciated...

Mike


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: sudo and firefox (was: Off-topic: Gmail Grrrr.)
    ... And configure sudo to keep $DISPLAY. ... I'm using "xhost" to do something similar, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Root privilege (SOLVED)
    ... and certainly more standard than your hack. ... please explain how I can use sudo to tranfer X credentials .. ... I'm curious as to what makes sux "more secure". ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Root privilege (SOLVED)
    ... please explain how I can use sudo to tranfer X credentials .. ... sudo does not transfer X credentials like sux does. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Off-topic: Gmail Grrrr.
    ... And configure sudo to keep $DISPLAY. ... I'm using "xhost" to do something similar, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Using setenv DISPLAY
    ... I could no longer use sudo to start ... gtk apps without "cannot open display error". ... $ sudo env | grep DISPLAY ... either setenv or export? ...
    (Debian-User)