Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-14-2004, 10:52 PM
|
#1
|
Member
Registered: Dec 2003
Location: New Brunswick, Canada
Distribution: Debian 10 Buster
Posts: 85
Rep:
|
Cannot run X applications as root
When I try to run an X application as root from a terminal. I get I get a Gtk-WARNING about display. From other threads I read, running export DISPLAY=:0 and then xhost + local:localhost fixes the problem. I tried that and it worked. Therefore it creates security vulnerability and also I have to do this at every boot. Does anyone know a permanent solution to this problem?
Thanks
JP
|
|
|
02-14-2004, 11:05 PM
|
#2
|
Member
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511
Rep:
|
How do you get to root? For me, if I just use 'su', GUI apps work fine. If I use 'su -', then I have problems.
|
|
|
02-15-2004, 08:02 AM
|
#3
|
Member
Registered: Dec 2003
Location: New Brunswick, Canada
Distribution: Debian 10 Buster
Posts: 85
Original Poster
Rep:
|
Thanks! I used "su -" instead of "su". I tried "su" and it works fine. Whats the difference between "su -" and "su" anyways?
|
|
|
02-15-2004, 08:42 AM
|
#4
|
Member
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79
Rep:
|
Quote:
Originally posted by jplev22
Whats the difference between "su -" and "su" anyways?
|
I believe that "su -" loads the user specific settings such as their paths, etc.
T
|
|
|
02-15-2004, 11:25 AM
|
#5
|
Member
Registered: Dec 2002
Location: Bolton, UK
Distribution: Kubuntu
Posts: 224
Rep:
|
We had a long thread going about this a while ago, but nobody came up with a solution. In Slackware 9.1 neither "su" or "su -" will allow you to launch an X application from a terminal.
Which is a bit of a pain if you've installed your kernel sources in /usr/src/ and want to run make xconfig as root to configure them (the workaround is to do "kdesu make xconfig" as a normal user in /usr/src/linux).
I've just been reading the UK Edition of Linux Magazine and there it tells you how to change this behaviour (it looks similar to jplev22's solution and is also temporary, until the next reboot).
Basically my question is the same as jplev22's, how do I permanently allow X applications to be launched by a user who has "su"-ed into root in an xterm?
Cheers
Amos
Last edited by amos; 02-15-2004 at 11:27 AM.
|
|
|
02-15-2004, 12:37 PM
|
#6
|
Member
Registered: Jul 2003
Posts: 659
Rep:
|
add the line
xhost +localhost
to /etc/profile
|
|
|
02-15-2004, 01:55 PM
|
#7
|
Member
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259
Rep:
|
actually, i found the easiers way is to just do this:
su -c "nameofprogram"
then type password
it lets you run the program as root
|
|
|
02-15-2004, 03:53 PM
|
#8
|
Member
Registered: Dec 2002
Location: Bolton, UK
Distribution: Kubuntu
Posts: 224
Rep:
|
vinay_s_s your suggestion works! Excellent!
Thanks a million.
Cheers
Amos
|
|
|
02-15-2004, 10:39 PM
|
#9
|
Newbie
Registered: Feb 2004
Location: CT, USA
Distribution: Debian stable
Posts: 29
Rep:
|
amos, I hunted through the docs a while ago and came up with:
|
|
|
All times are GMT -5. The time now is 07:16 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|