X11 forwarding on SSH after su
before you become su,get your MIT-MAGIC-Cookie
xauth list $DISPLAY
you’ll see an output like
myhost.mydomain:21 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae
switch to root (’su’)
add your cookie to the session
xauth add myhost.mydomain:21 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae
that’s it, now you can start your forwarded X11-Application
sometimes you have to set your $DISPLAY variable,so copy the value from ‘echo $DISPLAY’ before su and set export $DISPLAY=”myhost:XY” when you’re root
Posted August 5th, 2008 in General.