cannot run X application with su after a ssh login, one can face the following error :

root@ctrldb2:/home/ctrluser# emacs
X11 connection rejected because of wrong authentication.
Display localhost:10.0 unavailable, simulating -nw

In that case, solutions are 1)

ssh -X test@test_test.com

su -

xauth merge /home/test/.Xauthority

or 2)

use sux

posted by citadel