You are not logged in.

#1 2011-09-18 06:13:38

sunnieside-up
Member
Registered: 2011-08-10
Posts: 58

[SOLVED] Cannot open x apps with sudo

Hi all,

I just did a fresh install of kde in Arch, and I cannot open any x server apps, like kwrite, using "sudo kwrite". I tried xhost +localhost and my user name, but that didn't work. Then I tried tweaking the $DISPLAY... I couldn't get anything to happen either. Can anyone give me a few helpful pointers? Thanks!

Last edited by sunnieside-up (2011-09-20 05:56:56)

Offline

#2 2011-09-18 06:17:14

dmbrown
Member
From: Ohio, United States
Registered: 2011-09-18
Posts: 15

Re: [SOLVED] Cannot open x apps with sudo

Offline

#3 2011-09-18 06:31:17

sunnieside-up
Member
Registered: 2011-08-10
Posts: 58

Re: [SOLVED] Cannot open x apps with sudo

Ah thanks that fixed my su- apps! As for the sudo apps, I found that I had to do:
# export XAUTHORITY=/home/user_with_xauthority/.Xauthority

But I'm wondering, how to you permanantely change an environment variable? I have to set this on each session

Last edited by sunnieside-up (2011-09-18 06:39:53)

Offline

#4 2011-09-18 07:28:35

ybyygu
Member
From: Shanghai, China
Registered: 2011-09-18
Posts: 4

Re: [SOLVED] Cannot open x apps with sudo

try with "sudo -E gedit"

from sudo manual:
       -E          The -E (preserve environment) option indicates to the
                   security policy that the user wishes to preserve their
                   existing environment variables.  The security policy may
                   return an error if the -E option is specified and the user
                   does not have permission to preserve the environment.

Offline

#5 2011-09-18 08:11:08

Barafu Albino Cheetah
Member
From: Moscow
Registered: 2011-09-16
Posts: 34

Re: [SOLVED] Cannot open x apps with sudo

Using sudo -E with X apps is a bad idea, cause it may lead to some files in your home dir being switched to root owner, which will produce all sorts of weird errors.
There are applications gksu and kdesu especially designed to use instead of sudo for X apps.

Offline

#6 2011-09-20 05:57:05

sunnieside-up
Member
Registered: 2011-08-10
Posts: 58

Re: [SOLVED] Cannot open x apps with sudo

Thanks for all the tips!

Offline

Board footer

Powered by FluxBB