TrumanWong

xhost

Control which X clients can be displayed on the X server

Supplementary instructions

xhost command is an access control tool for the X server, used to control which X clients can be displayed on the X server. This command must be run from a machine with a display connection. A name can be removed from the access list by using the -host parameter. Do not remove the current name from the access list. If you have done this, log out of the system before making any changes.

grammar

xhost(parameter)

Parameters

  • +: Turn off access control and allow any host to access the local X server;
  • -: Turn on access control and only allow hosts in the authorization list to access the local X server.

Entering the xhost command without arguments will display the current hostname for access to the X server and display a message indicating whether access is enabled.

For security reasons, options that affect access control can only be run from the control host. For workstations, this machine is also the server. For the X terminal, this machine is the login host.

To enable remote names by default, define the name in the /etc/X?.hosts file, where ? is the monitor number to enable access.

For example, display jeanne:0 can be accessed by systems defined in the /etc/X0.hosts file on systems using jeanne's default hostname. In display names and file names, 0 indicates the defined display number that the remote system is allowed to access through enhanced X-Windows.

Note: The -name parameter defines the hostname to be removed from the X server access list. Existing connections are not interrupted, but new connection requests will be rejected. NOTE: The current machine can be removed; however, further connections (including attempts to add it back) are not allowed. The only way to enable local connections again is to reset the server (thus also breaking all connections).