Skip to main content

stealin' cookies

alice$ echo $DISPLAY
localhost:11.0

alice$ xhost +
access control disabled, clients can connect from any host

alice$ su - bob
bob$ DISPLAY=localhost:11.0 xclock
X11 connection rejected because of wrong authentication.
The reason for that is that X11 is using a magic cookie to authenticate against the specified X server. And we want that sweet bastard:
bob$ sudo cp ~alice/.Xauthority .
bob$ DISPLAY=localhost:11.0 xclock
Yes, it's that easy. But seem to forget things like this too often - now it's here, forever. And ever ;)