On 2010-11-29 19:36, please try again wrote:
>
> robin_listas;2259196 Wrote:
>> On 2010-11-29 11:06, please try again wrote:
>>> sudo -u gdm gnome-appearance-properties
>>
>> I’ve been told by people “in the know” to “NEVER EVER run X
>> applications with sudo”
>>
>
> papperlapapp !
No kidding. Ask DenverD 
> robin_listas;2259196 Wrote:
>>
>> Besides that, the user “gdm” can not login, so in fact it will run as
>> the user you call su or sudo instead, or fail.
>>
>> /etc/passwd:
>> gdm:x:50:109:Gnome Display Manager daemon:/var/lib/gdm:/bin/false
>>
>
> Nope. Besides, I didn’t intend to login as gdm.
Right, but the thing is, your sudo command line above doesn’t run in my
system. I know why: it is properly configured to require explicitly adding
a line for each command and user - it will not accept root’s password. It
is a restricted sudo configuration.
> robin_listas;2259196 Wrote:
>>
>> Telcontar:~ # sudo -u gdm gnome-appearance-properties
>> Cannot open display:
>>
>> (gnome-appearance-properties:30154): Gtk-WARNING **: cannot open
>> display:
>> Telcontar:~ # su - gdm -c gnome-appearance-properties
>> Telcontar:~ #
>>
>> and it doesn’t run.
>>
>
> Come on, Carlos! You do know how to open the display.
> But granted, I should have explained how to do it before (my display is
> open locally).
I know, but my intention was to point that it only fails with users like
“gdm”, because the password line denies it.
Code:
root 11339 0.0 0.0 26796 1940 ? S Nov27 0:00 /usr/sbin/gdm
root 12316 0.0 0.0 38648 2604 ? S Nov27 0:00 _
/usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
root 12317 0.8 1.6 273424 133064 tty7 Ss+ Nov27 23:06 _
/usr/bin/Xorg :0 -br -verbose -auth
/var/run/gdm/auth-for-gdm-AiDNwH/database -nolisten tcp vt7
root 12363 0.0 0.0 73608 2776 ? S Nov27 0:00 _
/usr/lib/gdm/gdm-session-worker
gdm 12345 0.0 0.0 15604 764 ? S Nov27 0:00
/usr/bin/dbus-launch --exit-with-session
cer 18132 0.0 0.0 6444 820 pts/19 S+ 22:36 0:00 _
grep gdm
> So again:
>
> - open a terminal
> - open the Xorg display to other local users:
> XHOST + LOCAL:
> - run gnome-appearance-properties as user gdm
> SUDO -U GDM DBUS-LAUNCH GNOME-APPEARANCE-PROPERTIES
This line will mandatorily fail in my system. So, I open visudo, add the
appropiate line:
cer Telcontar = (gdm) NOPASSWD: /usr/bin/gnome-appearance-properties
and try again:
Code:
cer@Telcontar:~> xhost + local:
non-network local connections being added to access control list
cer@Telcontar:~> sudo -u gdm gnome-appearance-properties
Cannot open display:
(gnome-appearance-properties:18769): Gtk-WARNING **: cannot open display:
cer@Telcontar:~>
And no program 
I also tried the dbus-launch variant, same result:
Code:
cer@Telcontar:~> sudo -u gdm /usr/bin/dbus-launch gnome-appearance-properties
Cannot open display:
(gnome-appearance-properties:19561): Gtk-WARNING **: cannot open display:
> If you don’t want to use sudo with X applications (because you believe
> what you’ve been told by people),
No, it is true, sudo doesn’t set the proper environment, like exporting the
display. It is a pity, but that’s it. If it were you or me who said so, I
would doubt it, but knowing who said so, I have to believe it.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)