Archive

Posts Tagged ‘display’

Accessing a User’s X Session as Root

February 16th, 2010 No comments

This is a very simple thing, but it seems not widely known.

You login to, or start, X as a regular user as you rightly should, but you want to be able to su to root and then run a GUI application as root.

There are a number of ways to do this, some better than others, including using “kdesu”, “xhost” etc; the simplest however is:

# xauth merge ~xuser/.Xauthority
# export DISPLAY=:0.0

… where xuser is the user you are running X as. The export line may not be required depending on how you became root.

The root shell you are in now has full authority to communicate with and manipulate X.

Categories: Linux, Miscellaneous Tags: , , ,