Running X programs as non root

Hello: I have some programs that try to run but fail to open the X display device. However it works fine when I am logged in and running X as root. I thought the 'sux' command would fix this program. Is there any way to run these programs short of logging out and starting X as root? Thanks, Jim

Jim Norton wrote:
Hello:
I have some programs that try to run but fail to open the X display device. However it works fine when I am logged in and running X as root.
I thought the 'sux' command would fix this program. Is there any way to run these programs short of logging out and starting X as root?
Thanks, Jim
Hi Jim I've *never* run X as root, and I would strongly suggest that you don't. If you need to run an X program as root, the either use 'sux' or 'kdesu' (assuming you're using KDE). I can't help you any more as your message is a little (?) vague as to what the problem is, and the subject line confuses me even more... :) -- GPG fingerprint = 3D45 5509 D380 26A4 523E A9D8 A66A 5F38 CA43 BB0E

Hi Jim
I've *never* run X as root, and I would strongly suggest that you don't. If you need to run an X program as root, the either use 'sux' or 'kdesu' (assuming you're using KDE).
I can't help you any more as your message is a little (?) vague as to what the problem is, and the subject line confuses me even more... :)
--
Thanks for the information. kdesu seems to work well. Just so you are not confused about what I was asking about, there are some programs such as unison ( in GUI mode ) and building a kernel make xconfig that will not be able to open the X screen device if you are not root. So in these cases I'd just log out of my normal user account and into root and do what I needed to do. I know about 'sux' but it doesn't always work. Just as an example of the type of error I got before when trying to xconfig a kernel as root: jrn@falcon:~> su Password: falcon:/home/jrn # cd /usr/src/linux falcon:/usr/src/linux # make xconfig rm -f include/asm ( cd include ; ln -sf asm-i386 asm) make -C scripts kconfig.tk make[1]: Entering directory `/usr/src/linux-2.4.22/scripts' cat header.tk >> ./kconfig.tk ./tkparse < ../arch/i386/config.in >> kconfig.tk echo "set defaults \"arch/i386/defconfig\"" >> kconfig.tk echo "set ARCH \"i386\"" >> kconfig.tk cat tail.tk >> kconfig.tk chmod 755 kconfig.tk make[1]: Leaving directory `/usr/src/linux-2.4.22/scripts' wish -f scripts/kconfig.tk Xlib: connection to ":0.0" refused by server Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison) Application initialization failed: this isn't a Tk applicationcouldn't connect to display ":0.0" Error in startup script: invalid command name "button" while executing "button .ref" (file "scripts/kconfig.tk" line 51) make: *** [xconfig] Error 1 falcon:/usr/src/linux # However, kdesu make config works great. Thanks again! -Jim-

On Friday 19 September 2003 7:11 pm, Jim Norton wrote:
Hi Jim
I've *never* run X as root, and I would strongly suggest that you don't. If you need to run an X program as root, the either use 'sux' or 'kdesu' (assuming you're using KDE).
I can't help you any more as your message is a little (?) vague as to what the problem is, and the subject line confuses me even more... :)
--
Thanks for the information. kdesu seems to work well. Just so you are not confused about what I was asking about, there are some programs such as unison ( in GUI mode ) and building a kernel make xconfig that will not be able to open the X screen device if you are not root.
So in these cases I'd just log out of my normal user account and into root and do what I needed to do. I know about 'sux' but it doesn't always work.
Just as an example of the type of error I got before when trying to xconfig a kernel as root:
jrn@falcon:~> su
Err, that should be sux, shouldn't it? If the app you are trying to run needs X then you must use sux not su Dylan -- Sweet moderation Heart of this nation Desert us not We are between the wars - Billy Bragg

Jim Norton wrote:
Thanks for the information. kdesu seems to work well. Just so you are not confused about what I was asking about, there are some programs such as unison ( in GUI mode ) and building a kernel make xconfig that will not be able to open the X screen device if you are not root.
So in these cases I'd just log out of my normal user account and into root and do what I needed to do. I know about 'sux' but it doesn't always work.
Just as an example of the type of error I got before when trying to xconfig a kernel as root:
You need to use 'sux' here.
jrn@falcon:~> su Password: falcon:/home/jrn # cd /usr/src/linux [snipped]
But if kdesu does the job, thats as good. You can also do the kernel config thingy through the Control Panel... which will prompt you for root's password. -- GPG fingerprint = 3D45 5509 D380 26A4 523E A9D8 A66A 5F38 CA43 BB0E

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 19 September 2003 20:11, Jim Norton wrote:
Hi Jim
<snip
jrn@falcon:~> su Password: falcon:/home/jrn # cd /usr/src/linux <snip>> wish -f scripts/kconfig.tk Xlib: connection to ":0.0" refused by server Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
You need to add as normal user before changing to root xhost +falcon
Application initialization failed: this isn't a Tk applicationcouldn't connect to display ":0.0" Error in startup script: invalid command name "button" while executing "button .ref" (file "scripts/kconfig.tk" line 51) make: *** [xconfig] Error 1 falcon:/usr/src/linux #
However, kdesu make config works great.
Thanks again!
-Jim-
- -- A child of five would understand this. Send someone to fetch a child of five. Groucho Marx - ---------------------------------------------------- This mail has been scanned for virus by AntiVir for UNIX Copyright (C) 1994-2003 by H+BEDV Datentechnik GmbH. PGP ID: 589F8449 Fingerprint: EB1C FACF 6BEB 540E 8AC0 F04E 2A25 A2F1 589F 8449 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/a26nKiWi8VifhEkRAsttAJ45GeSMzsVbzTqmXWUlQqLPfBqzcACeN5nu a4gJ94sfhFJhHrfMizjdqTU= =N+eR -----END PGP SIGNATURE-----

Hmm I know what you want, the way to do this was on this list a few months back, but I forget when or what it was called. Xlib: connection to ":0.0" refused by server is the error that can be fixed by setting up the X config for the root account. If you open X as root it works, if you use X as user it works, but something slightly different is needed to open a root X app in a user X session. Not sure if these vague ramblings help, but it is all I have for now 8-) David On Friday 19 September 2003 5:25 pm, Jim Norton wrote:
Hello:
I have some programs that try to run but fail to open the X display device. However it works fine when I am logged in and running X as root.
I thought the 'sux' command would fix this program. Is there any way to run these programs short of logging out and starting X as root?
Thanks, Jim
participants (5)
-
david stevenson
-
Dylan
-
Ian David Laws
-
jalal
-
jrn@oregonhanggliding.com