As thisuser, I go to shell and run $ su anotheruser. It asks for password and then switches the user. Then I run $ gedit anyfile. But now instead of opening gedit, it gives error:
No protocol specified
(gedit:388): Gtk-WARNING **: cannot open display: :20.0
How do I get this running?
EDIT:
Output of ls -l "$XAUTHORITY" when run as anotheruser
-rw------- 1 thisuser thisuser 260 Mar 31 22:35 /home/thisuser/.Xauthority