[ale] I'd like to be able to run X programs from root

Jim Lynch ale_nospam at fayettedigital.com
Wed Feb 1 05:49:08 EST 2012


On 01/31/2012 10:00 AM, Lightner, Jeff wrote:
> On a RHEL6 box I just tested doing standard ssh -X or ssh -Y it works the same as it did on RHEL5 (and RHEL4 and HP-UX 11i):
>
> Open the session to the box as normal user.
> Run "echo $DISPLAY" to see what display it set for that user e.g. localhost:10.0
>
> sudo su -
>
> After switch to root:
> export DISPLAY=<normal user's display>  (e.g. export DISPLAY=localhost:10.0)
> export XAUTHORITY=<normal user's home directory>/.Xauthority  (e.g. export XAUTHORITY=/home/jlightner/.Xauthority).
>
> Run xterm as a test to see if it displays back properly.
>
> If it works on RHEL6 it should work on CentOS6.
>
> I tested this both from a Windows XP workstation running Cygwin (X Win) and from a CentOS 5 workstation and it worked to display the Xterm to both of those workstations from the RHEL6 server.
>
I usually do a sudo -s so the DISPLAY variable is OK as is.  The key to 
making it work is the XAUTHORITY.

Thanks that works fine.


JIm.


More information about the Ale mailing list