DIGIT-ARC read-only archive · snapshot: July 23, 2026

gui-apps not opening, when i login as "su -"

9 posts · originally from https://geek.digit.in/community/threads/gui-apps-not-opening-when-i-login-as-su.25129/

praka123
praka123 Original post #1
Mar 9, 2006 at 5:46 AM
Hello All,
I use Debian Sarge .i cant open any gui apps for eg;gedit as "su -"
i tried exporting $DISPLAY value
Code:
prakash@sarge:~$ echo $DISPLAY
:0.0
prakash@sarge:~$ su -
Password:
sarge:~# export DISPLAY=:0.0
sarge:~# gedit
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gedit:9926): Gtk-WARNING **: cannot open display:
Code:
prakash@sarge:~$ xhost +
access control disabled, clients can connect from any host
now if i try opening gedit it will open.so any help..
eddie
eddie #2
Mar 9, 2006 at 10:25 AM
it is a security feature so that users don't run GUI apps as Root. Anyways, have a look here for a few solutions
*www.mepislovers-wiki.org/index.php?title=XHost_errors_when_trying_to_run_programs_as_root
praka123
Mar 9, 2006 at 12:41 PM
Nyways i already installed sux,which allows to run gui-apps when login as :
Code:
prakash@sarge:~$ sux -
Password:
sarge:~# gedit
but where do those security things cant we modify for logon..i understand that acl is enabled in default for most distros..but they allow running progs as "su",what is wrong with "su -"..thanks all.
GNUrag
GNUrag #4
Mar 9, 2006 at 1:40 PM
Your X Server is not allowing another user to open Your dosplay.

You need to disable X authentication.

$ xhost +

and then switch users;

Directly giving su retains your original user's environment variables, and su - loads the new user's environment profile. Hence the disparity.
praka123
Mar 9, 2006 at 7:59 PM
I dont want any compromise in security..so no "xhost +".for now happy with "sux -".i use this command as a shortcut in my gnome taskbar with "run in terminal ticked",so that if i click it show a passwd prompt and directly i can be root.this is for some purposes like
Code:
sarge:~# pon dsl-provider
and many uses.i am accustomed this way.thanks to all.but no real answer came :?
GNUrag
GNUrag #6
Mar 10, 2006 at 11:16 AM
prakash kerala said:
thanks to all.but no real answer came :?
What was your problem?
praka123
Mar 10, 2006 at 12:16 PM
GNUrag said:
What was your problem?

not a problem. a doubt-how can we enable "su -" to open gedit or any such xapps.thats what i am trying from starting of thread :)
GNUrag
GNUrag #8
Mar 10, 2006 at 1:09 PM
$ gksu gedit
$ gksudo gedit

Use any of the two, ideally put then as command for new launchers.

Does this solve your problem?
mediator
Mar 20, 2006 at 11:34 PM
nice info!