LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2005, 01:44 PM   #1
raven.sorrow
Member
 
Registered: Oct 2004
Distribution: Gentoo/FBSD/Slack
Posts: 65

Rep: Reputation: 15
Post xhost issues and the fix


Ever since I switched to slackware (BTW I'm a slack die hard now) I've been having issues w/ being able to start some apps as root. Let me give you a basic layout of my system first.

OS: Slackware 10.1
Kernel: 2.4.29
GUI: XFCE 4.2.1 (compiled from src not the preinstalled binaries from the slack dist cd (as they do not include everything)
RAM 1GB


Now I start XFCE from the "/usr/local/bin/startxfce" cmd as a user (in my case thats "xaero")
Code:
xaero@biggeek #: /usr/local/bin/startxfce &
xaero@biggeek #:
XFCE will start normally and attach itself to *:0.0 as expected.

Once XFCE starts I would start an "xterm" session that looked like this

Code:
bash-3.00$
if I tried to start a user space app it would start and wait till I exited the app and return the prompt to me. On some occasions I would need to start an app w/ root privileges it would fail and give me an error msg such as this:

Code:
root@biggeek: ~# Terminal

(Terminal:9416): Gtk-WARNING **: cannont open display:
root@biggeek:~#
to fix this I did the following

1. I created a file called xhost1 and put it in /home/xaero/bin
2 I added this to my /root/.profile
export DISPLAY=0:0

the contents of /home/xaero/bin/xhost1 is:
Code:
xhost +localhost
xhost +biggeek
xhost +biggeek.xaerolimit.net
xhost +192.168.0.6
xhost +127.0.0.1

So now all I need to do is su - to root and run the cmd I want and it will work.


Hopefully this will solve anyone's issues w/ xhost issues in the future
 
Old 05-15-2005, 01:55 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
My question would be, why are you needing to run applications in X as root to begin with? On a more secure note and I have a fetish with people who login with su - root since your still using root's password to login, users should just setup and use sudo and if they really need to launch an X program as root, instead of specifying a list of hosts that are all the same host, just do a "xhost +" and that allows all to launch the application when logged into X as one user and launching the application as another.

Regards.
 
  


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
Redhat Mail issues- Transport filter process failed -Will Pay$$ for fix. rixride00 Linux - Software 1 07-20-2005 08:10 AM
cpu load problem. Some issues to fix it? gottin Linux - General 4 09-04-2004 06:26 PM
FC2 MBR Fix issues -- strange sfdisk output Alterscape Fedora - Installation 0 07-16-2004 12:04 PM
News: LG Issues Fix to Revive Dead LG Drives kilgoretrout Mandriva 0 11-13-2003 10:05 AM
[NOT REALLY LINUX RELATED] How do i fix loopback issues? vbp6us Linux - General 3 04-20-2003 02:55 PM


All times are GMT -5. The time now is 09:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration