Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
|
 |
07-27-2003, 03:56 PM
|
#1
|
Member
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524
Rep:
|
XServer Connection Problem
I have been having the following problem lately:
When I run an X app under su in a terminal, I get the following error:
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
kedit: cannot connect to X server :0.0
In this case, I tried to run kedit to edit a file without having to log out and back in again as root, but the problem occurs with any program which uses X. I have found in other places that the command xhost +localhost removes this problem temporarily, but I would like to know if it is possible to make it go away for good.
I am running debian, with XFree4 and KDE 3.1
Any help would be most appreciated
Guy
|
|
|
07-27-2003, 04:03 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
# Allow root to use X
xhost +local:
su -
export DISPLAY=:0.0
|
|
|
07-28-2003, 10:36 AM
|
#3
|
Member
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524
Original Poster
Rep:
|
Unfortunately this does not work.
Again, it temporarily fixes the problem, but once I restart the X server, it no longer works.
|
|
|
07-28-2003, 10:58 AM
|
#4
|
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
If you want it to be automatic, put it in your .bashrc, .bash_profile or your .xinitrc or other X init file you might use. Then it activates on log-in.
You have to do root's command in root's .bashrc, IIRC. I think there is a posting about it in the hints thread in my sig.
|
|
|
08-01-2003, 08:44 AM
|
#5
|
Member
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524
Original Poster
Rep:
|
I put roots command in .bashrc, and the other command in my init files, but still it doesn't work. Sorry to be a pain.
|
|
|
08-03-2003, 02:54 PM
|
#6
|
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
Perhaps debian sources another file rather than the .bashrc in the home directory.
Does it work if you command:
source ./.bashrc
|
|
|
08-03-2003, 03:11 PM
|
#7
|
Member
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446
Rep:
|
If the DISPLAY variable is set to
yourhostname.yourdomain.COM:0.0
rather than just :0,
then you will need to issue the command
xhost + yourhostname.yourdomain.COM
before issuing the su - root command.
If the HOST variable is correctly set to your host name then you can just
do
xhost + $HOST
but note that if HOST is not set, then the above becomes
xhost +
which allows anybody on any machine anywhere who can connect to your machine access to your display.
The xhost + local: only enables non networked local connections from the localhost.
Automatically disabling the access control from the local machine is a BAD thing, since it enables any other user logged in on your machine to mess about with your DISPLAY and even run a program to see your screen and capture keystrokes (including the keys pressed for the root password when you su).
And if you say, "Oh this is on my home machine, and I am the only user" then remember that "Security begins at home" and habits, bad or good, formed there will be transferred to multi user machines in the business place.
|
|
|
All times are GMT -5. The time now is 01:01 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
|
|