Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 11-19-2003, 10:57 AM   #1
Registered: Oct 2003
Location: France/Italy
Distribution: Slackware Current
Posts: 83

Rep: Reputation: 15
Question Unable to launch X apps with non login root shell

I use Slackware9.1 with kdm/KDE3.1.4.
When I try to launch any X app logged in as a normal user but with root suid for example:

su -c "/opt/kde/bin/kedit"

I receive the following error message:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kedit: cannot connect to X server :0.0

I sense this is a trivial problem caused by my newbieness in my first Slackware months
and I've never really had the need to solve it, since one hardly needs to launch X apps as root
and one should hardly ever login as root... But what about using:

make xconfig/gconfig

While waiting for some help, I'll keep on searching forums, man pages, X documentation and Google for a solution.

Thanks in advance.
Old 11-19-2003, 11:17 AM   #2
Registered: Mar 2003
Location: Berlin
Distribution: Slackware current
Posts: 310

Rep: Reputation: 31
I only know some workarounds - but I believe there is a setting (that will hopefully be posted later on )

When I urgently need X as root I do it over the KMenu -> system programs and somewhere there is the Filemanager in superuser mode. There you can log in as root and start the binaries manually.

Another method is to share you X Server with the root user. You have to enter the command xhost as a normal user to allow "external" connections to the running XServer and then su and export DISPLAY= which will give your session a DISPLAY that X apps can use. Then you should be fine running X apps as root.

Another - and more sophisticated - way is to have two X login screens running. I haven't had the time to find out how yet but it is possible to have several Xs running just like you have several terminals running in runlevel 3.

So you can swith over (possibly with CTRL-ALT-F8) to the other XSession and login as root and run your program there. But... tell me how you did it if you figure it out.

Please consider that the first two solutions are merely a workaround but version 2 also works on a network if you replace the IPs respectively.
Old 11-24-2003, 03:32 AM   #3
Registered: Oct 2003
Location: France/Italy
Distribution: Slackware Current
Posts: 83

Original Poster
Rep: Reputation: 15
Thanks for your reply Misel.

It really helped me out of this silly problem.

I apologise for my laziness, though. I know I could have solved the problem by myself if I extensively STFW and RTFM, which *in this case*, I didn't.

Well, this had taught me better to do those before asking on the forums.

Thanks again.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to login as user; can login as root. rksanders Debian 24 02-09-2011 08:01 AM
wrong login shell prevent root login cefs99 Linux - Security 4 05-31-2006 08:28 AM
unable to open apps when 'su'ing to root from user account ganja_guru Linux - Software 3 06-03-2005 10:51 AM
unable to change root shell sandin Slackware 3 04-17-2005 08:33 AM
Menu troubles: apps do not launch; unable to add apps hfinger Mandriva 1 08-22-2003 04:49 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration