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

Notices


Reply
  Search this Thread
Old 02-14-2004, 10:52 PM   #1
jplev22
Member
 
Registered: Dec 2003
Location: New Brunswick, Canada
Distribution: Debian 10 Buster
Posts: 85

Rep: Reputation: 16
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
 
Old 02-14-2004, 11:05 PM   #2
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
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.
 
Old 02-15-2004, 08:02 AM   #3
jplev22
Member
 
Registered: Dec 2003
Location: New Brunswick, Canada
Distribution: Debian 10 Buster
Posts: 85

Original Poster
Rep: Reputation: 16
Thanks! I used "su -" instead of "su". I tried "su" and it works fine. Whats the difference between "su -" and "su" anyways?
 
Old 02-15-2004, 08:42 AM   #4
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Rep: Reputation: 15
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
 
Old 02-15-2004, 11:25 AM   #5
amos
Member
 
Registered: Dec 2002
Location: Bolton, UK
Distribution: Kubuntu
Posts: 224

Rep: Reputation: 30
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.
 
Old 02-15-2004, 12:37 PM   #6
vinay_s_s
Member
 
Registered: Jul 2003
Posts: 659

Rep: Reputation: 30
add the line
xhost +localhost
to /etc/profile
 
Old 02-15-2004, 01:55 PM   #7
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Rep: Reputation: 30
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
 
Old 02-15-2004, 03:53 PM   #8
amos
Member
 
Registered: Dec 2002
Location: Bolton, UK
Distribution: Kubuntu
Posts: 224

Rep: Reputation: 30
vinay_s_s your suggestion works! Excellent!

Thanks a million.

Cheers
Amos
 
Old 02-15-2004, 10:39 PM   #9
liquigel
Newbie
 
Registered: Feb 2004
Location: CT, USA
Distribution: Debian stable
Posts: 29

Rep: Reputation: 15
amos, I hunted through the docs a while ago and came up with:
Code:
xhost +local:root
 
  


Reply


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
Can't run gui applications as root vdogvictor Linux - General 26 08-19-2004 08:24 PM
i need to applications to run faster paimpozhil General 22 06-02-2004 12:05 PM
getting applications to run on Kernel 2.6.4 jwspring Linux - Software 3 04-02-2004 08:38 PM
How to install and then run new applications carjumble Linux - Newbie 5 12-24-2003 03:22 PM
Unable to run X applications remotely pree Linux - Software 0 06-27-2003 01:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:16 PM.

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