/etc/X11/Xsession.d/35x11-common_xhost-local Give access to the X server to the same user on the local host. If the xhost command is available, it will use it to allow any process of the same user running on the local host to access the X server.
# This file is sourced by Xsession(5), not executed.
# If xhost (from x11-xserver-utils) is installed, use it to give access # to the X server to any process from the same user on the local host. # Unlike other uses of xhost, this is safe since the kernel can check # the actual owner of the calling process.
iftype xhost >/dev/null 2>&1; then xhost +si:localuser:$(id -un) || : fi
xhost命令简介如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
NAME xhost - server access control program for X
SYNOPSIS xhost [[+-]name ...]
DESCRIPTION The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. In the case of hosts, this provides a rudimentary form of privacy control and security. It is only sufficient for a workstation (single user) environment, although it does limit the worst abuses. Environments which require more sophisticated measures should implement the user- based mechanism or use the hooks in the protocol for passing other authentication data to the server.