<s>
In	O
the	O
X	B-Operating_System
Window	I-Operating_System
System	I-Operating_System
,	O
programs	O
run	O
as	O
X	B-Operating_System
clients	O
,	O
and	O
as	O
such	O
they	O
connect	O
to	O
the	O
X	B-Operating_System
display	O
server	O
,	O
possibly	O
via	O
a	O
computer	B-Architecture
network	I-Architecture
.	O
</s>
<s>
There	O
are	O
five	O
standard	O
access	O
control	O
mechanisms	O
that	O
control	O
whether	O
a	O
client	O
application	O
can	O
connect	O
to	O
an	O
X	B-Operating_System
display	O
server	O
.	O
</s>
<s>
Additionally	O
,	O
like	O
every	O
other	O
network	O
connection	O
,	O
tunneling	B-Protocol
can	O
be	O
used	O
.	O
</s>
<s>
The	O
host-based	O
access	O
method	O
consists	O
in	O
specifying	O
a	O
set	O
of	O
hosts	O
that	O
are	O
authorized	O
to	O
connect	O
to	O
the	O
X	B-Operating_System
display	O
server	O
.	O
</s>
<s>
The	O
xhost	B-Device
program	B-Application
and	O
three	O
X	B-Device
Window	I-Device
System	I-Device
core	I-Device
protocol	I-Device
requests	O
are	O
used	O
to	O
activate	O
this	O
mechanism	O
and	O
to	O
display	O
and	O
change	O
the	O
list	O
of	O
authorized	O
hosts	O
.	O
</s>
<s>
Improper	O
use	O
of	O
xhost	B-Device
can	O
inadvertently	O
give	O
every	O
host	O
on	O
the	O
Internet	O
full	O
access	O
to	O
an	O
X	B-Operating_System
display	O
server	O
.	O
</s>
<s>
The	O
cookie-based	O
authorization	O
methods	O
are	O
based	O
on	O
choosing	O
a	O
magic	O
cookie	O
(	O
an	O
arbitrary	O
piece	O
of	O
data	O
)	O
and	O
passing	O
it	O
to	O
the	O
X	B-Operating_System
display	O
server	O
when	O
it	O
is	O
started	O
;	O
every	O
client	O
that	O
can	O
prove	O
having	O
knowledge	O
of	O
this	O
cookie	O
is	O
then	O
authorized	O
connecting	O
to	O
the	O
server	O
.	O
</s>
<s>
These	O
cookies	O
are	O
created	O
by	O
a	O
separate	O
program	B-Application
and	O
stored	O
in	O
the	O
file	O
.Xauthority	B-Device
in	O
the	O
user	O
's	O
home	O
directory	O
,	O
by	O
default	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
every	O
program	B-Application
run	O
by	O
the	O
client	O
on	O
the	O
local	O
computer	O
can	O
access	O
this	O
file	O
and	O
therefore	O
the	O
cookie	O
that	O
is	O
necessary	O
for	O
being	O
authorized	O
by	O
the	O
server	O
.	O
</s>
<s>
If	O
the	O
user	O
wants	O
to	O
run	O
a	O
program	B-Application
from	O
another	O
computer	O
on	O
the	O
network	O
,	O
the	O
cookie	O
has	O
to	O
be	O
copied	O
to	O
that	O
other	O
computer	O
.	O
</s>
<s>
How	O
the	O
cookie	O
is	O
copied	O
is	O
a	O
system-dependent	O
issue	O
:	O
for	O
example	O
,	O
on	O
Unix-like	B-Operating_System
platforms	O
,	O
scp	B-Protocol
can	O
be	O
used	O
to	O
copy	O
the	O
cookie	O
.	O
</s>
<s>
The	O
two	O
systems	O
using	O
this	O
method	O
are	O
MIT-MAGIC-COOKIE-1	O
and	O
XDM-AUTHORIZATION-1	O
.	O
</s>
<s>
In	O
the	O
second	O
method	O
,	O
a	O
secret	O
key	O
is	O
also	O
stored	O
in	O
the	O
.Xauthority	B-Device
file	O
.	O
</s>
<s>
The	O
xauth	B-Device
application	O
is	O
a	O
utility	O
for	O
accessing	O
the	O
.Xauthority	B-Device
file	O
.	O
</s>
<s>
The	O
environment	O
variable	O
XAUTHORITY	B-Device
can	O
be	O
defined	O
to	O
override	O
the	O
name	O
and	O
location	O
of	O
that	O
cookie	O
file	O
.	O
</s>
<s>
The	O
implemented	O
by	O
the	O
for	O
direct	O
communication	O
between	O
X11	B-Operating_System
clients	O
uses	O
the	O
same	O
MIT-MAGIC-COOKIE-1	O
authentication	O
method	O
,	O
but	O
has	O
its	O
own	O
iceauth	O
utility	O
for	O
accessing	O
its	O
own	O
.ICEauthority	O
file	O
,	O
the	O
location	O
of	O
which	O
can	O
be	O
overridden	O
with	O
the	O
environment	O
variable	O
ICEAUTHORITY	O
.	O
</s>
<s>
ICE	O
is	O
used	O
,	O
for	O
example	O
,	O
by	O
DCOP	B-Language
and	O
the	O
X	B-Operating_System
Session	O
Management	O
protocol	O
(	O
XSMP	O
)	O
.	O
</s>
<s>
The	O
two	O
methods	O
based	O
on	O
authenticating	O
users	O
using	O
networked	O
identity	O
management	O
systems	O
are	O
SUN-DES-1	O
and	O
MIT-KERBEROS-5	O
.	O
</s>
<s>
The	O
first	O
system	O
is	O
based	O
on	O
a	O
secure	O
mechanism	O
of	O
the	O
ONC	B-Protocol
remote	I-Protocol
procedure	I-Protocol
call	I-Protocol
system	O
developed	O
in	O
SunOS	B-Operating_System
.	O
</s>
<s>
The	O
second	O
mechanism	O
is	O
based	O
on	O
both	O
client	O
and	O
server	O
trusting	O
a	O
Kerberos	B-Protocol
server	O
.	O
</s>
<s>
The	O
xhost	B-Device
program	B-Application
can	O
be	O
used	O
to	O
add	O
or	O
remove	O
localuser	O
and	O
localgroup	O
entries	O
with	O
this	O
method	O
.	O
</s>
<s>
The	O
SSH	B-Protocol
utility	O
(	O
when	O
invoked	O
with	O
option	O
-X	O
or	O
option	O
ForwardX11	O
)	O
tunnels	O
X11	B-Operating_System
traffic	O
from	O
remotely	O
invoked	O
clients	O
to	O
the	O
local	O
server	O
.	O
</s>
<s>
It	O
does	O
so	O
by	O
setting	O
at	O
the	O
remote	O
site	O
the	O
DISPLAY	O
environment	O
variable	O
to	O
point	O
to	O
a	O
local	O
TCP	O
socket	O
opened	O
there	O
by	O
sshd	O
,	O
which	O
then	O
tunnels	O
the	O
X11	B-Operating_System
communication	O
back	O
to	O
ssh	B-Protocol
.	O
</s>
<s>
Sshd	O
then	O
also	O
calls	O
xauth	B-Device
to	O
add	O
at	O
the	O
remote	O
site	O
an	O
MIT-MAGIC-COOKIE-1	O
string	O
into	O
.Xauthority	B-Device
there	O
,	O
which	O
then	O
authorizes	O
X11	B-Operating_System
clients	O
there	O
to	O
access	O
the	O
ssh	B-Protocol
user	O
's	O
local	O
X	B-Operating_System
server	O
.	O
</s>
<s>
X11	B-Operating_System
connections	O
between	O
client	O
and	O
server	O
over	O
a	O
network	O
can	O
also	O
be	O
protected	O
using	O
other	O
secure-channel	O
protocols	O
,	O
such	O
as	O
Kerberos/GSSAPI	O
or	O
TLS	B-Protocol
,	O
although	O
such	O
options	O
are	O
now	O
far	O
more	O
rarely	O
used	O
than	O
SSH	B-Protocol
.	O
</s>
