XAUTHORITY
Xauthority refers to the authentication mechanism used by the X Window System to control access to an X server. It is commonly associated with the per-user file called at ~/.Xauthority, which stores authorization records that permit X clients to connect to the user’s display. When an X client starts, it must present a valid authorization cookie; the X server checks the cookie against the records in the Xauthority file. The most widely used scheme is MIT-MAGIC-COOKIE-1, though other schemes such as XDM-AUTHORIZATION-1 exist. The cookies are managed by the xauth program, which can display, merge, or extract cookies, and is used by login and session startup processes to populate the file.
Location and format: The file is usually located at ~/.Xauthority in the user’s home directory, or at
SSH and X11 forwarding: When SSH X11 forwarding is enabled, the system manages a temporary cookie for
Security considerations: Access to the Xauthority file should be restricted; insecure permissions can allow another user