This is due to X11 cookies. When you login your coockies match but when you su <user> the cookies don't match and the X server kills the connection to you.
Originally Posted by cbo0485
You need to ensure that the user you are su'ing to has the same cookie you are using.
when you connect and before you su to the new user
From the terminal type
This will list your current secret cookie that your X client and the X server share to authenticate.
xauth list $DISPLAY
Here is mine (slightly edited)
You then need to ensure that the user you are su'ing to will use the same cookie as you.
matthew-S206:/home/matthew % xauth list $DISPLAY
matthew-S206/unix:0 MIT-MAGIC-COOKIE-1 52829xxxxxxxxxx51fab2e2abddfb26d
xauth should do this for you
On my system it wouold be
xauth add <cookie details>
Which is basically "xauth add" and a copy and paste of the cookie details returned from xauth list $DISPLAY.
xauth add matthew-S206/unix:0 MIT-MAGIC-COOKIE-1 52829xxxxxxxxxx51fab2e2abddfb26d
Then try su'ing to the new user.
Post back on efficacy as this is an AIX box.