Re: Adding hosts to the xhosts list permanently
Using xhost is a security nightmare - you open your X server to ANY process on the designated host.
This is maintained only by the X server, and is only usable when the TCP socket is enabled. This allows the server to fail secure if the X server is restarted. The problem using a /etc/Xn.hosts file is that EVERY user of the designated display can get unauthorized connections.
Another problem is that the X server doesn't just use "X0.hosts", when user login switching is used, you can get "X[0,1,2,...40] (I've seen 40 on my system), making maintaining the file unreasonable.
Normally, the X server has TCP connections disabled.
Use ssh to tunnel X protocol securely. Easier, and doesn't require any work.