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 |
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.
|
 |
08-31-2002, 11:23 PM
|
#1
|
Member
Registered: Jun 2002
Distribution: Debian/Ubuntu
Posts: 56
Rep:
|
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.
|
|
|
09-01-2002, 11:33 AM
|
#2
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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.
|
|
|
09-01-2002, 09:59 PM
|
#3
|
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:
|
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.
|
|
|
09-01-2002, 10:00 PM
|
#4
|
Member
Registered: Jun 2002
Distribution: Debian/Ubuntu
Posts: 56
Original Poster
Rep:
|
I am running this from a terminal within X. Sorry I wasn't specific about that.
|
|
|
09-01-2002, 10:02 PM
|
#5
|
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:
|
Yeah, I thought so. You're probably using su - from within xterm
|
|
|
10-27-2002, 07:11 PM
|
#6
|
Member
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306
Rep:
|
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.
|
|
|
10-27-2002, 11:28 PM
|
#7
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
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. . .
|
|
|
All times are GMT -5. The time now is 09:52 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
|
|