Showing results for 
Search instead for 
Did you mean: 

still need help with xhost

Go to solution

still need help with xhost

I have an application on my server that need "xhost +" to be executed from the console to run well. How i can make my "xhost +" to start as the system boot?


December 05, 2000 15:15 PM GMT

to generally turn off access control create the file


with the contents


This will allow any host to have acces to the X server.

See also 'man xhost'

Albert E. Whale

December 05, 2000 15:16 PM GMT


The simplest place to put this command is in the /etc/inittab file. You can use the following syntax:

xhst:234:once:/usr/bin/X11/xhost +

Have a Great Day!

Manuel Plaza

December 05, 2000 15:17 PM GMT

Hi Jasmin,
You can use /etc/X0.hosts. This is an ASCII file that contains the hostnames autorized to use the X display. You must have the name of your server and so is not necesssary to use the "xhost +" command.


December 05, 2000 15:17 PM GMT

Hi Jasmine:

do a man on Xserver. It says in there that you should create a /etc/Xn.hosts where n is the display number (eg. 0) and place in there, the addresses of the hosts to allow... I am guessing if you

# echo "+" >> /etc/X0.hosts

it should do what you want.

Kenneth Platz

December 05, 2000 15:40 PM GMT


Unfortunately Rainer is incorrect. The /etc/X0.hosts file should be a list of hosts that are automatically granted access to the X server. Also, since the X server will attempt to ping every host in this file during initialization, if any host in here is not a valid hostname (including the "+" character) this will instead create a situation where the X server will fail to completely initialise, and you will most likely end up with a black screen.

The easiest way of completely disabling access control on your X server (ie, the equivalent of doing an "xhost +" at the console) would be to add the "-ac" command-line option to the "/usr/bin/X11/X" command-line. If your system uses CDE, then you would want to edit /etc/dt/config/Xservers, and modify it so the "local" entry appears as follows:

* local local@console /usr/bin/X11/X :0 -ac

I hope this helps

Jasmin Berube

December 05, 2000 18:28 PM GMT

I tried to put "-ac" option in /etc/dt/config/Xservers file as mentionned. If I do "xhost" command on the console it says access control disable, but it doesn't work until I do "xhost +" again.... Have an idea?
Honored Contributor

Re: still need help with xhost

are you using CDE ?
If so you could add the line

/usr/bin/X11/xhost +

into your $HOME/.dtprofile
Alex Glennie
Honored Contributor

Re: still need help with xhost

I would suggest concentrating on the /etc/X0.hosts file : add the names of the server and the locally display to this file eg :

save the file and init 2 init 3 to restart the Xserver process.

Try your script now ?