It either shows no display or broken X.
I did some research and found the key is the .Xauthority. If I can get it to merge into other users' .Xauthority, the X11 forwarding under SSH would work perfectly.
Attached is a step by step instruction to show users how to get it done with screenshots in it.
The steps are:
- Connect to the server as yourself (no special account like root, admin and others)
- Find DISPLAY value
- echo $DISPLAY (keep this for later use)
- Change permission on .Xauthority
- chmod 644 .Xauthority
- Become root user by using sudo
- sudo su
- Become app user by using su
- su - <appuser>
- Merge your .Xauthority into this app user’s .Xauthority (it will create a new one if it does not exist)
- HP-UX: /usr/bin/X11/xauth merge $HOME/.Xauthority ($HOME is your home directory)
- Solaris: /usr/openwin/X11/xauth merge $HOME/.Xauthority ($HOME is your home directory
- Set DISPLAY environment variable
- HP-UX: setenv DISPLAY xxx.xxx.xxx.xxx:yy.z (value from step 5a)
- Solaris: export DISPLAY=xxx.xxx.xxx.xxx:yy.z (value from step 5a)
- Try to launch X Clock
- HP-UX: /usr/bin/X11/xclock
- Solaris: /usr/openwin/X11/xclock
- It works if you see the xclock!!