Where does xhost store allowed network addresses?

Where does xhost store allowed network addresses?

+4
source share
3 answers

xhost just calls XAddHost , etc. , which manages the list stored on the server. See xhost/xhost.c for the client side and xserver/os/access.c for the server side.

You really should try using xauth instead of xhost if possible. It stores a list of valid keys that can be used for each user, for each client, instead of relying only on the host name (falsified in an unfriendly environment).

+4
source

I think the addresses are stored inside xserver.

xhost without any arguments should print the current allowed list.

+4
source
 $ man xhost | grep -A 2 FILES FILES /etc/X*.hosts 

So, I would look at / etc for a file matching this pattern.

A more general lesson is here: many teams that use certain files during their work will document these files on their manual pages. So, it is a good idea when someone wonders something like this to check the manual. The FILES section is often at the bottom, so a quick "person" followed by a ">" ( less to go to the end of the file) often shows what you are looking for.

0
source

All Articles