LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-15-2004, 06:52 PM   #1
Li...
Member
 
Registered: Feb 2004
Posts: 31

Rep: Reputation: 15
Question no access for root on X-server (local)


Hi,

on my X-server the superuser (root) have no access to the X-server. When I try to run by example xload as superuser, then I get the message:

-----
$/root# xload
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0
$/root#
-----

Does anybody know what can I do to fix this? Currently installed distribution is Debian woody/sid.

Li
 
Old 02-15-2004, 06:54 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
are you logged into X as a normal user, and trying to run things from a terminal logged in as root ?
 
Old 02-15-2004, 07:02 PM   #3
Li...
Member
 
Registered: Feb 2004
Posts: 31

Original Poster
Rep: Reputation: 15
Yes, I log in (X-server, kdm) as normal user and then I open a terminal session (rxvt), change my ID with 'su -' or 'su'.
 
Old 02-15-2004, 07:19 PM   #4
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
well thats the whole problem ...
you can't log in as one user, and try to run something as another user within that users session ..
read this
 
Old 02-15-2004, 09:48 PM   #5
smith847be
Member
 
Registered: Jun 2003
Location: Hanover, New Hampshire, USA
Distribution: Debian Sid (Unstable)
Posts: 143

Rep: Reputation: 15
Just to put this on this thread, here you go: Run this command first (while you are logged in as the normal user):

xhost +local:root

or this will allow access by any user on that physical computer:

xhost +localhost

That allows root/others to have access to the x server. See the man pages for xhost. This, however is only effective for that session, so if you always want root access, then you need to put this in a startup script.

Last edited by smith847be; 02-16-2004 at 10:16 AM.
 
Old 02-16-2004, 03:43 AM   #6
eaglegst
Member
 
Registered: Dec 2003
Location: Australia
Distribution: Woody, Sarge, Sid
Posts: 83

Rep: Reputation: 15
I recommand use gdm as default display manager.
 
Old 02-16-2004, 07:41 AM   #7
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
Quote:
Originally posted by smith847be
YES YOU CAN! Run this command first (while you are logged in as the normal user):

xhost +local:root
dont' make it sound like your proving me wrong ...
that info is in the link i suppled
 
Old 02-16-2004, 10:17 AM   #8
smith847be
Member
 
Registered: Jun 2003
Location: Hanover, New Hampshire, USA
Distribution: Debian Sid (Unstable)
Posts: 143

Rep: Reputation: 15
Sorry, DrOzz, didn't notice that link when I first saw this. "you can't log in as one user, and try to run something as another user within that users session ..". That made it sound like you were saying otherwise - that's what I was responding to.
 
Old 02-16-2004, 05:12 PM   #9
Li...
Member
 
Registered: Feb 2004
Posts: 31

Original Poster
Rep: Reputation: 15
The solution for my problem was found!

I've tried the xhost +local:root and it works!
Few month or weeks ago I've tried this with the xhost command as well as the Xauthority, but both failed. The xhost command which I've used was only xhost +127.0.0.1 and that does not work.

Thanks for you fast response, I put this command in the xserver startup script.

Li
 
Old 02-16-2004, 05:45 PM   #10
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
Why do you want root to have so much access to the Xserver like this? Most systems with Gnome and KDE will caution you that its not a good idea to log in to X as root when you try.
 
Old 02-16-2004, 05:57 PM   #11
Li...
Member
 
Registered: Feb 2004
Posts: 31

Original Poster
Rep: Reputation: 15
The reason is: When I try to install or remove packages with a graphical front-end I've to be root. Some other tools for this task are checking the UID before running. That I have to be root on a x-session is very rare.

Li
 
Old 02-16-2004, 06:01 PM   #12
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
Don't enable it by default then. That's opening up a risk you don't need. Perhaps you can make a little shell script to do it when you need to execute the tool as root.

What distro are you running? I ask because most prompt you for your root password before churning ahead with the GUI tool.
 
  


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 access external server from local network newuser455 Linux - Networking 7 05-30-2005 12:47 AM
How to access mysql server on local server ? Tancrede Linux - Newbie 2 04-09-2005 12:12 PM
Can't access external server from local network newuser455 Linux - Networking 4 11-26-2004 02:09 PM
local root can access nis users??? pao Linux - Security 1 07-29-2004 01:06 AM
only root users can access vnc server dlm4444 Linux - Newbie 1 05-01-2004 02:47 PM

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

All times are GMT -5. The time now is 04:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration