Graphical Environment Guide
Chapter 4, Running remote programs

Granting access to specific hosts

Granting access to specific hosts

The X server maintains a list of machines that have access to the display. You must establish this list even if you plan to only grant access to users with an authorization code.

To grant access to your display for specific host machines, perform the following steps.

  1. To specify system-wide access permissions, edit the /etc/Xn.hosts file, where n represents the display number that you want the host machine to be able to access. Add the names of the host machines to which you want to grant access. This step is optional. (Do not add hosts to this file if you only want to grant access to your display for one session.) You must be root to edit these files.

    The access permissions take effect when the X server is restarted.

  2. To specify display access permissions for a single X session, run the server and add or remove host machines in the access permission list with xhost(X). Any user can perform this step.
The desired host machines now have permission to access your display.