LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-31-2002, 11:23 PM   #1
blueplazma
Member
 
Registered: Jun 2002
Distribution: Debian/Ubuntu
Posts: 56

Rep: Reputation: 15
Root problems with X


When I try to run a program that runs in X as root from a terminal I get this error:

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

Gtk-WARNING **: cannot open display :0.0

and then nothing happens.

Also... can anyone tell me where exactly blocked packets from iptables would be logged? Thanks.
 
Old 09-01-2002, 11:33 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can't run a program from the terminal. Instead, run X (startx) and you can run programs from terminals, but from terminals running in X.
 
Old 09-01-2002, 09:59 PM   #3
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Sounds like the X server is running - it was startx-ed by someone else.

Any other user ( not even root) cannot USE the services offerered by the X server unless the client program authenticates with the server. Unless, we have the MIT-MAGIC-COOKIE in the server user's ~/.Xauthority. this is the cookie that the Xserver starts with and all clients are supposed to use to connect to it.

Since it is root who wants to connect, and root can read any file in the system it that makes it a li'l easier for you to deal with this.

Run the command as root right before you run the x client prog. You are extracting the cookie that the X server was instructed to authenticate with ( when someguy started the server ) and adding it to root's cookie file.
xauth -f ~someguy/.Xauthority list :0.0 | awk '{ printf("add :0.0 . %s",$NF); }' | xauth -q
see man xauth

Last edited by nxny; 09-01-2002 at 11:00 PM.
 
Old 09-01-2002, 10:00 PM   #4
blueplazma
Member
 
Registered: Jun 2002
Distribution: Debian/Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 15
I am running this from a terminal within X. Sorry I wasn't specific about that.
 
Old 09-01-2002, 10:02 PM   #5
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Yeah, I thought so. You're probably using su - from within xterm
 
Old 10-27-2002, 07:11 PM   #6
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Rep: Reputation: 30
I have discovered that this happens if you use kdm or xdm (haven't tried with gdm). When i used login.app i didn't have this problem, but if i used xdm it appeared.
 
Old 10-27-2002, 11:28 PM   #7
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
To allow other users (even root) to access your X session, use:

xhost +localhost

Then make sure your other user has their environment DISPLAY set
correctly (looks like it above) by either:
setenv DISPLAY localhost:0.0
or
export DISPLAY=localhost:0.0

Then run your X program. . .
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with root proNick Ubuntu 4 11-16-2005 03:10 AM
x problems when not under root tehnick Debian 2 04-20-2005 04:41 AM
Problems with root Jamsoft Linux - Newbie 6 02-25-2005 10:59 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
Root Command Problems BittaBrotha Debian 11 07-31-2003 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:44 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