xauth(X) X Version 11 (Release 4) xauth(X) Name xauth - X authority file utility Syntax xauth [-f authfile] [-vqib] [command arg...] Description The xauth program is used to edit and display the authorization informa- tion used in connecting to the Xsco server. Use xauth to extract authori- zation records from one machine and merge them with authorization records on another (as is the case when using remote logins or to grant access to other users). Commands (described below) may be entered interactively, on the xauth command line, or in scripts. Note that this program does not contact the X server. Options The following options may be used with xauth. They may be given individ- ually (for example, -q -i) or they may be combined (for example, -qi). -f authfile specifies the name of the authority file to use. By default, xauth uses the file specified by the XAUTHORITY environment vari- able or .Xauthority in the user's home directory. -q xauth operates quietly and does not print unsolicited status mes- sages. This is the default if an xauth command is given on the command line or if the standard output is not directed to a ter- minal. -v xauth operates verbosely and prints status messages indicating the results of various operations (for example, how many records have been read in or written out). This is the default if xauth is reading commands from its standard input and its standard out- put is directed to a terminal. -i xauth ignores any authority file locks. Normally, xauth refuses to read or edit any authority files that have been locked by other programs (usually xdm or another xauth). -b xauth attempts to break any authority file locks before proceed- ing and should only be used to clean up stale locks Commands The following commands may be used to manipulate authority files: add displayname protocolname hexkey adds an authorization entry for the indicated display using the given protocol and key data to the authorization file. The data is specified as an even-lengthed string of hexadecimal digits, each pair representing one octet. The first digit gives the most significant 4 bits of the octet and the second digit gives the least significant 4 bits. A protocol name consisting of just a single period is treated as an abbreviation for MIT-MAGIC- COOKIE-1. [n]extract filename displayname... writes authorization entries for each of the specified displays to the indicated file. If the nextract command 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 the merge and nmerge commands. If the filename consists of just a single dash, the entries are written to the standard output. [n]list [displayname...] prints authorization entries for each of the specified displays (or all if no displays are named) on the standard output. If the nlist command is used, entries are shown in the numeric format used by the nextract command; otherwise, they are shown in a tex- tual format. Key data is always displayed in the hexadecimal format given in the description of the add command. [n]merge [filename...] reads authorization entries from the specified files and merges them into the authorization database, superceding any matching existing entries. If the nmerge command is used, the numeric for- mat given in the description of the extract command is used. If filename is a single dash, the standard input is read if it hasn't already been read by another command. remove displayname... removes authorization entries matching the specified displays from the authority file source filename treats filename as a script containing xauth commands to execute. Blank lines and lines beginning with a sharp sign (#) are ignored. If filename is a single dash the standard input is read if it hasn't already been read by another command. info prints to standard output information describing the authoriza- tion file, whether or not any changes have been made, and the source of the xauth commands. exit If any modifications have been made, the authority file is writ- ten out (if allowed), and the program exits. An end of file is treated as an implicit exit command. quit exits the program, ignoring any modifications. This may also be accomplished by pressing the interrupt character. help [string] prints descriptions of all commands that begin with the given string (or all commands if no string is given) on the standard output ? prints a short list of the valid commands on the standard output Display names Display names for the add, [n]extract, [n]list, [n]merge, and remove com- mands 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 is ignored. Same-machine connections (such as local-host sockets, shared memory, and the Internet Protocol hostname localhost) are referred to as hostname/unix:displaynum- ber 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 author- ity file on the remote machine. For example: % xauth extract - $DISPLAY | rsh other xauth merge - Environment xauth uses the following environment variables: XAUTHORITY the name of the authority file to use if the -f option isn't used. If this variable is not set, xauth uses .Xauthority in the user's home directory. HOME the user's home directory if XAUTHORITY isn't defined. Limitations Users that have unsecure networks should take care to use encrypted file transfer mechanisms to copy authorization entries between machines. Simi- larly, the MIT-MAGIC-COOKIE-1 protocol is not very useful in unsecure environments. Sites that are interested in additional security may need to use encrypted authorization mechanisms such as Kerberos. Spaces are currently not allowed in the protocol name. Copyright Copyright 1989, Massachusetts Institute of Technology. See X(X) for a full statement of rights and permissions.