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

Lightner, Jeff JLightner at water.com
Tue Jan 31 10:00:49 EST 2012


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.






-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Jim Lynch
Sent: Tuesday, January 31, 2012 8:38 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] I'd like to be able to run X programs from root

On 01/31/2012 06:59 AM, Jim Kinney wrote:
>
> Ah. Root has to build an xauthority file. Login from console as root
> and run startx and that should do it. Then ssh -X wiil work as long as
> you su and not su -.  Your nonroot ssh user also must loginto X once
> from console as well.
> Gvim is not a security sensitive application.
>
>
OK thanks, I'll give it a try.

Jim.
_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo




Athena(r), Created for the Cause(tm)
Making a Difference in the Fight Against Breast Cancer

---------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------




More information about the Ale mailing list