Step 1: Disabling system-wide display access
The X server only employs its authorization
protocol if all host access is disabled.
Because the X server obtains a list of authorized hosts
each time it starts, make sure the
server provides no initial access permissions.
To disable initial host access, edit the /etc/Xn.hosts file that corresponds to your display. The /etc/Xn.hosts files determine which host machines have access to the X server, regardless of who starts the server. For example, to remove initial access permissions for local display :0, remove all host names from /etc/X0.hosts.
Make sure xhost is not executed automatically from your $HOME/.startxrc file or from a file in your $HOME/.odtpref directory.