xhost  the server access control program for X.


  • xhost + hostname: Adds hostname to X server access control list.
  • xhost – hostname: Removes hostname from X server access control list.
  • xhost + : Turns off acccess control (all remote hosts will have access to X server)
  • xhost – : Turns access control back on.

Example of a Typical Use

Assume the IP address of the local host is and the IP address of the remote host is Depending on the network you are on, you may also be able to use the computer names (domain names) instead of the IP addresses.

Step 1. On the local host

Type the following at the command line:

% xhost +
< press return >

Step 2. Log on to the remote host

% telnet

Step 3. On the remote host (through the telnet connection)

Instruct the remote host to display windows on the local host by typing:

% setenv DISPLAY

at the command line. (Instead of setenv you may have to use export on certain shells.)

< press return >

Step 4. Now you can run software from the remote host.

E.g.: when you type % xterm on the remote host, you should see an xterm window on the local host.

Step 5. After You Finish

You should remove the remote host from your access control list as follows. On the local host type:

% xhost – 
< press return >