- Create or edit the file "/etc/Xn.hosts" where 'n' is the display number of the server on the local host, normally 0, as in "/etc/X0.hosts".
To deny all X access to your system, the file /etc/X0.hosts will contain a single character, "-".
To grant access to hosts "host1.com" and "host2.com" and no other hosts the file /etc/X0.hosts will consist of:
- Search through all files in the directory /usr/lib/X11/xdm for occurances of the command "xhost +" or "/usr/bin/X11/xhost +". Remove or comment out all such lines.
- Inform users that any xhost commands should be removed or commented out of user startup scripts, such as .cshrc, .login, .profile, etc.