HeadlinesBriefing favicon HeadlinesBriefing.com

Sharing an X Server Across Hosts with Family Wild

Hacker News •
×

The article explains why X11 applications fail with "Authorization required" when run across different hosts, containers, or chroots. The . Xauthority file stores cookies keyed by family and hostname; when the client's hostname doesn't match the cookie's, X rejects the connection.

The fix involves Family Wild, a wildcard family with numeric value 0xffff that matches any hostname. Using xauth nlist and sed, the family field in a cookie entry can be rewritten from 0100 to ffff, producing a portable cookie file. A hex dump comparison shows the edit is just two bytes at the start of each record, leaving the address and cookie intact.

The article contrasts this approach with xhost +, which disables host-based access control entirely and creates security risks by allowing any client to read keystrokes and inject input. Family Wild keeps the cookie requirement while removing only the hostname constraint. A caveat notes that Family Wild cookies are less specific and should be shared only with trusted environments.

The technique is useful for forwarding X into unprivileged LXC containers.