Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
allow root to start programs using x
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Titeuf
l33t
l33t


Joined: 19 Jun 2004
Posts: 759
Location: Middelkerke, Belgium

PostPosted: Wed Jun 30, 2004 10:23 pm    Post subject: allow root to start programs using x Reply with quote

I've logged in as a normal user. When I open a terminal and use su to go to root, and then wants to launch a program that uses the x-server I get this:
Code:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwrite: cannot connect to X server :0.0

How can I make xfree doesn't refuse te connection ?
Back to top
View user's profile Send private message
kiezpro
Tux's lil' helper
Tux's lil' helper


Joined: 13 May 2004
Posts: 126
Location: Yes

PostPosted: Wed Jun 30, 2004 10:27 pm    Post subject: Reply with quote

It's a bit confusing, but you need to enable X connections from localhost, like this:
Code:
xhost + localhost

Do this as your regular user, not as root.
Back to top
View user's profile Send private message
CompNerd
Retired Dev
Retired Dev


Joined: 16 Mar 2003
Posts: 311
Location: 127.0.0.1

PostPosted: Thu Jul 01, 2004 5:10 am    Post subject: Reply with quote

Allowing connections from unauthorized connections can be percieved as a security risk. Once you are done, I would suggest that you do the following to reset the server's authentication settings.

Code:
xhost -


CompNerd
Back to top
View user's profile Send private message
Titeuf
l33t
l33t


Joined: 19 Jun 2004
Posts: 759
Location: Middelkerke, Belgium

PostPosted: Thu Jul 01, 2004 9:40 am    Post subject: Reply with quote

I've tried the xhost + localhost thing (as a normal user).
It says:
Code:
localhost being added to access control list

So I don't think there is a problem here.
But when I su, and then launches for instance kwrite, I still get the same error:
Code:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwrite: cannot connect to X server :0.0

Can somebody help me with this ?
Back to top
View user's profile Send private message
Celtis
l33t
l33t


Joined: 05 Jul 2003
Posts: 737

PostPosted: Thu Jul 01, 2004 9:50 am    Post subject: Reply with quote

Code:
*  x11-misc/sux
      Latest version available: 1.0-r1
      Latest version installed: 1.0
      Size of downloaded files: 9 kB
      Homepage:    http://fgouget.free.fr/sux/sux-readme.shtml
      Description: "su" wrapper which transfers X credentials
      License:     X11


Emerge sux and then use that instead of su.
Back to top
View user's profile Send private message
Titeuf
l33t
l33t


Joined: 19 Jun 2004
Posts: 759
Location: Middelkerke, Belgium

PostPosted: Thu Jul 01, 2004 9:51 am    Post subject: Reply with quote

This solved my problem.
Thank you
Back to top
View user's profile Send private message
10drill
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2004
Posts: 104
Location: 0{here}1

PostPosted: Thu Jul 01, 2004 1:06 pm    Post subject: Reply with quote

I asked this question before too...another solution is if you are using KDE (as it sounds like you are with kwrite) you can do something like:

Code:
kdesu kwrite
Back to top
View user's profile Send private message
polle
Veteran
Veteran


Joined: 28 Feb 2003
Posts: 1498
Location: Belgium

PostPosted: Thu Jul 01, 2004 1:12 pm    Post subject: Reply with quote

or before you su to root do this:

export XAUTHORITY=/home/foo/.Xauthority
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon Aug 02, 2004 5:44 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=9109
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum