1XAUTH(1) General Commands Manual XAUTH(1)
2
3
4
6 xauth - X authority file utility
7
9 xauth [ -f authfile ] [ -vqibn ] [ command arg ... ]
10
12 The xauth program is used to edit and display the authorization infor‐
13 mation used in connecting to the X server. This program is usually
14 used to extract authorization records from one machine and merge them
15 in on another (as is the case when using remote logins or granting
16 access to other users). Commands (described below) may be entered
17 interactively, on the xauth command line, or in scripts. Note that
18 this program does not contact the X server except when the generate
19 command is used. Normally xauth is not used to create the authority
20 file entry in the first place; xdm does that.
21
23 The following options may be used with xauth. They may be given indi‐
24 vidually (e.g., -q -i) or may combined (e.g., -qi).
25
26 -f authfile
27 This option specifies the name of the authority file to use.
28 By default, xauth will use the file specified by the XAUTHORITY
29 environment variable or .Xauthority in the user's home direc‐
30 tory.
31
32 -q This option indicates that xauth should operate quietly and not
33 print unsolicited status messages. This is the default if an
34 xauth command is given on the command line or if the standard
35 output is not directed to a terminal.
36
37 -v This option indicates that xauth should operate verbosely and
38 print status messages indicating the results of various opera‐
39 tions (e.g., how many records have been read in or written
40 out). This is the default if xauth is reading commands from
41 its standard input and its standard output is directed to a
42 terminal.
43
44 -i This option indicates that xauth should ignore any authority
45 file locks. Normally, xauth will refuse to read or edit any
46 authority files that have been locked by other programs (usu‐
47 ally xdm or another xauth).
48
49 -b This option indicates that xauth should attempt to break any
50 authority file locks before proceeding. Use this option only
51 to clean up stale locks.
52
53 -n This option indicates that xauth should not attempt to resolve
54 any hostnames, but should simply always print the host address
55 as stored in the authority file.
56
58 The following commands may be used to manipulate authority files:
59
60 add displayname protocolname hexkey
61 An authorization entry for the indicated display using the
62 given protocol and key data is added to the authorization file.
63 The data is specified as an even-lengthed string of hexadecimal
64 digits, each pair representing one octet. The first digit of
65 each pair gives the most significant 4 bits of the octet, and
66 the second digit of the pair gives the least significant 4
67 bits. For example, a 32 character hexkey would represent a
68 128-bit value. A protocol name consisting of just a single
69 period is treated as an abbreviation for MIT-MAGIC-COOKIE-1.
70
71
72 generate displayname protocolname [trusted|untrusted]
73 [timeout seconds] [group group-id] [data hexdata]
74
75 This command is similar to add. The main difference is that
76 instead of requiring the user to supply the key data, it con‐
77 nects to the server specified in displayname and uses the SECU‐
78 RITY extension in order to get the key data to store in the
79 authorization file. If the server cannot be contacted or if it
80 does not support the SECURITY extension, the command fails.
81 Otherwise, an authorization entry for the indicated display
82 using the given protocol is added to the authorization file. A
83 protocol name consisting of just a single period is treated as
84 an abbreviation for MIT-MAGIC-COOKIE-1.
85
86 If the trusted option is used, clients that connect using this
87 authorization will have full run of the display, as usual. If
88 untrusted is used, clients that connect using this authoriza‐
89 tion will be considered untrusted and prevented from stealing
90 or tampering with data belonging to trusted clients. See the
91 SECURITY extension specification for full details on the
92 restrictions imposed on untrusted clients. The default is
93 untrusted.
94
95 The timeout option specifies how long in seconds this autho‐
96 rization will be valid. If the authorization remains unused
97 (no clients are connected with it) for longer than this time
98 period, the server purges the authorization, and future
99 attempts to connect using it will fail. Note that the purging
100 done by the server does not delete the authorization entry from
101 the authorization file. The default timeout is 60 seconds.
102
103 The group option specifies the application group that clients
104 connecting with this authorization should belong to. See the
105 application group extension specification for more details.
106 The default is to not belong to an application group.
107
108 The data option specifies data that the server should use to
109 generate the authorization. Note that this is not the same
110 data that gets written to the authorization file. The inter‐
111 pretation of this data depends on the authorization protocol.
112 The hexdata is in the same format as the hexkey described in
113 the add command. The default is to send no data.
114
115
116 [n]extract filename displayname...
117 Authorization entries for each of the specified displays are
118 written to the indicated file. If the nextract command is
119 used, the entries are written in a numeric format suitable for
120 non-binary transmission (such as secure electronic mail). The
121 extracted entries can be read back in using the merge and
122 nmerge commands. If the filename consists of just a single
123 dash, the entries will be written to the standard output.
124
125 [n]list [displayname...]
126 Authorization entries for each of the specified displays (or
127 all if no displays are named) are printed on the standard out‐
128 put. If the nlist command is used, entries will be shown in
129 the numeric format used by the nextract command; otherwise,
130 they are shown in a textual format. Key data is always dis‐
131 played in the hexadecimal format given in the description of
132 the add command.
133
134 [n]merge [filename...]
135 Authorization entries are read from the specified files and are
136 merged into the authorization database, superceding any match‐
137 ing existing entries. If the nmerge command is used, the
138 numeric format given in the description of the extract command
139 is used. If a filename consists of just a single dash, the
140 standard input will be read if it hasn't been read before.
141
142 remove displayname...
143 Authorization entries matching the specified displays are
144 removed from the authority file.
145
146 source filename
147 The specified file is treated as a script containing xauth com‐
148 mands to execute. Blank lines and lines beginning with a sharp
149 sign (#) are ignored. A single dash may be used to indicate
150 the standard input, if it hasn't already been read.
151
152 info Information describing the authorization file, whether or not
153 any changes have been made, and from where xauth commands are
154 being read is printed on the standard output.
155
156 exit If any modifications have been made, the authority file is
157 written out (if allowed), and the program exits. An end of
158 file is treated as an implicit exit command.
159
160 quit The program exits, ignoring any modifications. This may also
161 be accomplished by pressing the interrupt character.
162
163 help [string]
164 A description of all commands that begin with the given string
165 (or all commands if no string is given) is printed on the stan‐
166 dard output.
167
168 ? A short list of the valid commands is printed on the standard
169 output.
170
172 Display names for the add, [n]extract, [n]list, [n]merge, and remove
173 commands use the same format as the DISPLAY environment variable and
174 the common -display command line argument. Display-specific informa‐
175 tion (such as the screen number) is unnecessary and will be ignored.
176 Same-machine connections (such as local-host sockets, shared memory,
177 and the Internet Protocol hostname localhost) are referred to as host‐
178 name/unix:displaynumber so that local entries for different machines
179 may be stored in one authority file.
180
182 The most common use for xauth is to extract the entry for the current
183 display, copy it to another machine, and merge it into the user's
184 authority file on the remote machine:
185
186 % xauth extract - $DISPLAY | rsh otherhost xauth merge -
187
188 The following command contacts the server :0 to create an authorization
189 using the MIT-MAGIC-COOKIE-1 protocol. Clients that connect with this
190 authorization will be untrusted.
191 % xauth generate :0 .
192
194 This xauth program uses the following environment variables:
195
196 XAUTHORITY
197 to get the name of the authority file to use if the -f option
198 isn't used.
199
200 HOME to get the user's home directory if XAUTHORITY isn't defined.
201
203 $HOME/.Xauthority
204 default authority file if XAUTHORITY isn't defined.
205
207 Users that have unsecure networks should take care to use encrypted
208 file transfer mechanisms to copy authorization entries between
209 machines. Similarly, the MIT-MAGIC-COOKIE-1 protocol is not very use‐
210 ful in unsecure environments. Sites that are interested in additional
211 security may need to use encrypted authorization mechanisms such as
212 Kerberos.
213
214 Spaces are currently not allowed in the protocol name. Quoting could
215 be added for the truly perverse.
216
218 Jim Fulton, MIT X Consortium
219
220
221
222X Version 11 xauth 1.0.2 XAUTH(1)