XAUTH(1)
๐ xauth ๐
X Version 11, bestie. The X authority file utility, but make it fashion. โจ
โจ NAME โจ
xauth โ X authority file utility. ๐
โจ SYNOPSIS โจ
xauth [ -f authfile ] [ -vqibn ] [ command arg ... ]
โจ DESCRIPTION โจ
Okay so xauth is the program you use to edit and display the authorization info that lets you connect to the X server. Usually it's the main character for extracting authorization records from one machine and merging them in on another โ like when you're doing remote logins or granting access to other users. Commands (they're described below, keep scrolling) can be entered interactively, right on the xauth command line, or in scripts.
Not me pointing out that this program does not contact the X server except when the generate command is used. Normally xauth is not used to create the authority file entry in the first place โ the program that starts the X server (often xdm or startx) does that. So don't come for xauth for that, okay? ๐
โจ OPTIONS โจ
The following options may be used with xauth. They may be given individually (e.g., -q -i) or may combined (e.g., -qi). Slay. ๐
-fauthfileโ This option specifies the name of the authority file to use. By default,xauthwill use the file specified by theXAUTHORITYenvironment variable or.Xauthorityin the user's home directory. ๐-qโ This option indicates thatxauthshould operate quietly and not print unsolicited status messages. This is the default if anxauthcommand is given on the command line or if the standard output is not directed to a terminal. ๐คซ-vโ This option indicates thatxauthshould operate verbosely and print status messages indicating the results of various operations (e.g., how many records have been read in or written out). This is the default ifxauthis reading commands from its standard input and its standard output is directed to a terminal. ๐ฃ๏ธ-iโ This option indicates thatxauthshould ignore any authority file locks. Normally,xauthwill refuse to read or edit any authority files that have been locked by other programs (usuallyxdmor anotherxauth). ๐-bโ This option indicates thatxauthshould attempt to break any authority file locks before proceeding. Use this option only to clean up stale locks. โ ๏ธ-nโ This option indicates thatxauthshould not attempt to resolve any hostnames, but should simply always print the host address as stored in the authority file. ๐-V,--versionโ This option shows the version number of thexauthexecutable. ๐
โจ COMMANDS โจ
The following commands may be used to manipulate authority files. Periodt. ๐
add displayname protocolname hexkeyโ An authorization entry for the indicated display using the given protocol and key data is added to the authorization file. The data is specified as an even-lengthed string of hexadecimal digits, each pair representing one octet. The first digit of each pair gives the most significant 4 bits of the octet, and the second digit of the pair gives the least significant 4 bits. For example, a 32 characterhexkeywould represent a 128-bit value. A protocol name consisting of just a single period is treated as an abbreviation forMIT-MAGIC-COOKIE-1.
WARNING: This usage is considered insecure since the secret magic cookie will be displayed in command histories and for example the output ofps. One should use the"merge"command (as described below) instead. Pay attention to its warning as well. ๐ญ
generate displayname protocolname [trusted|untrusted] [timeout seconds] [group group-id] [data hexdata]โ This command is similar toadd. The main difference is that instead of requiring the user to supply the key data, it connects to the server specified indisplaynameand uses theSECURITYextension in order to get the key data to store in the authorization file. If the server cannot be contacted or if it does not support theSECURITYextension, the command fails. Otherwise, an authorization entry for the indicated display using the given protocol is added to the authorization file. A protocol name consisting of just a single period is treated as an abbreviation forMIT-MAGIC-COOKIE-1.
If the trusted option is used, clients that connect using this authorization will have full run of the display, as usual. If untrusted is used, clients that connect using this authorization will be considered untrusted and prevented from stealing or tampering with data belonging to trusted clients. See the SECURITY extension specification for full details on the restrictions imposed on untrusted clients. The default is untrusted. ๐
The timeout option specifies how long in seconds this authorization will be valid. If the authorization remains unused (no clients are connected with it) for longer than this time period, the server purges the authorization, and future attempts to connect using it will fail. Note that the purging done by the server does not delete the authorization entry from the authorization file. The default timeout is 60 seconds. โณ
The group option specifies the application group that clients connecting with this authorization should belong to. See the application group extension specification for more details. The default is to not belong to an application group. ๐ฏ
The data option specifies data that the server should use to generate the authorization. Note that this is not the same data that gets written to the authorization file. The interpretation of this data depends on the authorization protocol. The hexdata is in the same format as the hexkey described in the add command. The default is to send no data. ๐ฆ
[n]extract filename displayname...โ Authorization entries for each of the specified displays are written to the indicated file. If thenextractcommand is used, the entries are written in a numeric format suitable for non-binary transmission (such as secure electronic mail). The extracted entries can be read back in using themergeandnmergecommands. If thefilenameconsists of just a single dash, the entries will be written to the standard output. ๐ค[n]list [displayname...]โ Authorization entries for each of the specified displays (or all if no displays are named) are printed on the standard output. If thenlistcommand is used, entries will be shown in the numeric format used by thenextractcommand; otherwise, they are shown in a textual format. Key data is always displayed in the hexadecimal format given in the description of theaddcommand. ๐[n]merge [filename...]โ Authorization entries are read from the specified files and are merged into the authorization database, superseding any matching existing entries. If thenmergecommand is used, the numeric format given in the description of theextractcommand is used. If afilenameconsists of just a single dash, the standard input will be read if it hasn't been read before.
WARNING: Be careful with the single dash version as depending on the command chain (for example a combination usingsudo), the secret key could be exposed to prying eyes in command histories and for example in the output ofps. ๐
remove displayname...โ Authorization entries matching the specified displays are removed from the authority file. ๐๏ธsource filenameโ The specified file is treated as a script containingxauthcommands to execute. Blank lines and lines beginning with a sharp sign (#) are ignored. A single dash may be used to indicate the standard input, if it hasn't already been read. ๐infoโ Information describing the authorization file, whether or not any changes have been made, and from wherexauthcommands are being read is printed on the standard output. โน๏ธexitโ If any modifications have been made, the authority file is written out (if allowed), and the program exits. An end of file is treated as an implicitexitcommand. ๐ชquitโ The program exits, ignoring any modifications. This may also be accomplished by pressing the interrupt character. โ๏ธversionโ This command shows the version number of thexauthexecutable. ๐ขhelp [string]โ A description of all commands that begin with the given string (or all commands if no string is given) is printed on the standard output. ๐?โ A short list of the valid commands is printed on the standard output. โ
โจ DISPLAY NAMES โจ
Display names for the add, [n]extract, [n]list, [n]merge, and remove commands use the same format as the DISPLAY environment variable and the common -display command line argument. Display-specific information (such as the screen number) is unnecessary and will be ignored. Same-machine connections (such as local-host sockets, shared memory, and the Internet Protocol hostname localhost) are referred to as hostname/unix:displaynumber so that local entries for different machines may be stored in one authority file. ๐ฅ๏ธ
โจ EXAMPLE โจ
The most common use for xauth is to extract the entry for the current display, copy it to another machine, and merge it into the user's authority file on the remote machine:
% xauth extract - $DISPLAY | ssh otherhost xauth merge -
The following command contacts the server :0 to create an authorization using the MIT-MAGIC-COOKIE-1 protocol. Clients that connect with this authorization will be untrusted.
% xauth generate :0 .
โจ ENVIRONMENT โจ
This xauth program uses the following environment variables:
XAUTHORITYโ to get the name of the authority file to use if the-foption isn't used. ๐HOMEโ to get the user's home directory ifXAUTHORITYisn't defined. ๐ก
โจ FILES โจ
$HOME/.Xauthorityโ default authority file ifXAUTHORITYisn't defined. ๐
โจ SEE ALSO โจ
X(7), Xsecurity(7), xhost(1), Xserver(1), xdm(1), startx(1), Xau(3). ๐
๐ BUGS ๐
okay bestie, real talk, this is the "things that will absolutely end you if you're not careful" section, so pay attention ๐ซถ
- if you're on an insecure network (and you know if you are, no cap), you should take care to use encrypted file transfer mechanisms to copy authorization entries between machines. fr fr, don't just fling your cookies across the wire like it's nothing ๐ญ
- similarly, the
MIT-MAGIC-COOKIE-1protocol is not very useful in insecure environments. it's giving "I left the front door open but the vibes are immaculate" ๐ - sites that are interested in additional security may need to use encrypted authorization mechanisms such as Kerberos ๐
- and here's a lil quirky one: spaces are currently not allowed in the protocol name. the manpage says quoting could be added for the truly perverse and honestly? iconic. whoever wrote that knew exactly what they were doing ๐
ngl bestie, "for the truly perverse" is the most unhinged thing to find in a manpage and I am obsessed with it ๐
๐ AUTHOR ๐
Jim Fulton, MIT X Consortium
that's the icon, the legend, the main character who wrote this whole thing. we stan ๐
and that's a wrap on the whole XAUTH(1) page bestie!! ๐โจ this is xauth 1.1.5, dated 2025-04-13 โ so go forth, manage your .Xauthority like the absolute genius you are, keep your cookies encrypted, and never put a space in a protocol name ๐๐
mwah ๐ go slay โจ๐ฆ๐ธ
๐ฆ where this page comes from
- alpine 3.24: xauth-doc 1.1.5-r0 ยท custom
- arch rolling: xorg-xauth 1.1.5-1 ยท MIT-open-group
- fedora 44: xorg-x11-xauth 1:1.1.5-1.fc44 ยท MIT-open-group
- nixos 26.05: xauth 1.1.5
- nixpkgs unstable: xauth 1.1.5
- Copyright 1993, 1998 The Open Group
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms