Xmanager Knowledge Base

xhost and how to use it

Last modified: Wednesday, February 27, 2013 12:19 AM

xhost overview

xhost is a program that controls access for X server. You can use xhost to limit access for X server for security reasons. The following message is what you get when connection is rejected by xhost:

Xlib: connection to "" refused by server
Xlib: No protocol specified

Error: Can't open display:

Block all access (xhost -) and only allow local applications, you would use:

-bash-3.2$ xhost -
access control enabled, only authorized clients can connect

To allow all host, you would use:

-bash-3.2$ xhost +
access control disabled, clients can connect from any host

To block or allow specific host, you would use:

$ xhost +
This command allows access from the host,

$ xhost -
This command blocks access from the host,

Using access control in xmanager

Xmanager is an X Server and has xhost feature built-in. By default, Xmanager allows connection from any hosts. To enable xhost access control:

1. Open Xconfig and double click on Default Profile (or select an appropriate Xconfig profile, if you are using a different profile for your Xmanager session)

2. Click on the Security tab
3. Select the Enable Access Control option
4. Enter the IP address or the host name in the Trusted Hosts list
5. Click OK