If you really feel the need to do this, then while you are root, get the current $DISPLAY
value, particularly the first value after the colon, which is 10
in your case. Then find the current X authorisation token for your session:
xauth list | grep ":10 "
Which will give you something like:
hostname/unix:10 MIT-MAGIC-COOKIE-1 2b3e51af01827d448acd733bcbcaebd6
After you su
to the oracle
account, $DISPLAY
is probably still set but if not then set it to match your underlying session. Then add the xauth
token to your current session:
xauth add hostname/unix:10 MIT-MAGIC-COOKIE-1 2b3e51af01827d448acd733bcbcaebd6
When you've finished you can clean up with:
xauth remove hostname/unix:10
That's assuming PuTTY is configured to use MIT-Magic-Cookie-1
as the remote X11 authentication protocol, in the Connection->SSH->X11 section. If that is set to MDM-Authorization-1
then the value you get and set with xauth
will have XDM-AUTHORIZATION-1
instead.
It might be simpler to disconnect from root
and start a new ssh
session as oracle
to continue the installation, which would also make sure you don't accidentally do anything unexpected as root
. Well, until you have to run root.sh
, anyway.
If you do a silent install with a response file then you don't need a working X11 connection anyway; you just need $DISPLAY
to be set, but nothing is ever actually opened on that display so it doesn't matter if xdpyinfo
or any other X11 command would fail. I'm not sure how you're thinking of scripting the X11 session, but even if that is possible a silent install will be simpler and more repeatable.