It seems that xhost does not accept a specific user prior to the hostname as a limiting criteria. See example: rain@BH2 ~ $ xhost access control enabled, only authorized clients can connect LOCAL: rain@BH2 ~ $ xhost +inet:rain@BH rain@BH being added to access control list X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 109 (X_ChangeHosts) Value in failed request: 0xfe Serial number of failed request: 7 Current serial number in output stream: 9 rain@BH2 ~ $ xhost access control enabled, only authorized clients can connect LOCAL: rain@BH2 ~ $ Reproducible: Always Steps to Reproduce: 1. As regular user running X type "xhost +inet:anybody@anywhere" 2. Watch it crash. 3. Happens everytime when you specify "user@" before the hostname. Actual Results: Instead of adding the user and hostname, xhost says it already did and crashes. After the crash, "xhost" without parameters reports the same state as before attempting to add user. Expected Results: According to the manpage,... When Secure RPC is being used, the network independent netname (e.g., "nis:unix. uid@domainname") can be specified, or a local user can be specified with just the username and a trailing at-sign (e.g., "nis:pat@"). I'm not exactly sure if this is meant to work for "inet:" families as well (but i'd be surprised if you couldn't specify the user), and i couldn't try because my xhost is only compiled for inet. However, i'm almost positive it shouldn't crash at least. I am using the most recent Xorg version (6.8.0-r2), however, i've noticed the same problem in the previous version (and i upgraded in hope that somebody discovered the bug already :-). Linux kernel gentoo-dev-sources-2.6.8-r9 (most recent), but this obviously has nothing to do with sources, as the bug persists even when i upgrade. PS: xhost man page is very incomprehensible, google out "xhost: bad hostname", i didn't find a single resolution to the problem of different local users connecting to the X server, other than the insecure "xhost +", and it's not exactly clear you need to do "xhost +Local:" from the manpage. Also, Local: is just a little bit less insecure, because it obviously does not accept user (ie. xhost +Local:root), and even though it's called family, it has only one empty member, thus "+Local:anything" always opens the X server for all locally logged users who specify the correct display.
Is this via ssh? If so, try the -Y option to ssh.
Has nothing to do with ssh. I was trying to add trusted users to xhost, and i used local login (namely Konsole - xterm). Oh and i forgot to mention that i also have full permissions to do it, ie. i own the display, and i'm not running xhost as another user.
I think what you may want is xauth.
Ahh, this will work. Thanks alot! (However, xhost still crashes for me under the conditions described, i guess it could say instead that there's a better utility to do the job, and not point out in the man page that you can "specify host name or a user name", which is rather confusing. Or something like that.)
It appears that the username is only allowed in xhost when using NIS.
If you'd like to file a bug at bugs.freedesktop.org on the clarity of the man page, feel free to do so. It'll probably get committed faster if you actually attach a diff to the man page. Thanks!