From my local machine I ssh
to a remote server along with authentication regarding X display. I know that in this process, MIT-MAGIC-COOKIES
are used and the value in both server and client needs to be identical in order for the authentication process to be valid.
However, when I login to a remote server and have confirmed that X display stuff are working well (e.g. executing xclock
to see if the xclock
application is popped up in my local machine), when I check the value of the cookies, the value in local machine and that in the remote server seems to be different. Here's the command lines:
cookie value in remote server
chulhyun@chulhyun-Inspiron-3420:~$ ssh -X Black@$labcom
Last login: Wed Jun 25 10:02:25 2014 from
Black@Black-PC ~
$ xclock ### xclock appears in local machine.
Black@Black-PC ~
$ xauth list
Black-PC/unix:10 MIT-MAGIC-COOKIE-1 708f623489b1ea129a77e98287d130ca
cookie value in local machine
chulhyun@chulhyun-Inspiron-3420:~$ xauth list
chulhyun-Inspiron-3420/unix:0 MIT-MAGIC-COOKIE-1 5ddd2ce92004eab53ceee8a64b7b88c0
As you can see the cookie value in two machines are different. Then shouldn't the X display not work?
What am I missing here?
P.S. I heard that $XAUTHORITY
contains the path to the xauthority
file and I've checked that path in local machine:
chulhyun@chulhyun-Inspiron-3420:~$ echo $XAUTHORITY
/var/run/gdm/auth-for-chulhyun-iZfH2u/database
When I take a look into the "database" file, the contents are unreadable because the contents are composed of weird characters.
^A^@^@^Vchulhyun-Inspiron-3420^@^A0^@^RMIT-MAGIC-COOKIE-1^@^P]?,? ^D??<??? K{??
could this be related to the question?
update
result of xhost
and $XAUTHORITY
in remote server
Black@Black-PC ~
$ xhost
access control enabled, only authorized clients can connect
SI:localuser:chulhyun
Black@Black-PC ~
$ echo $XAUTHORITY
*as it turns out $XAUTHORITY
is not defined... is this normal?
result of xhost
in local machine
chulhyun@chulhyun-Inspiron-3420:~$ xhost
access control enabled, only authorized clients can connect
SI:localuser:chulhyun
xhost -SI:localuser:chulhyun
– LatinSuD Jun 25 '14 at 12:01localuser:chulhyun being removed from access control list
but still X display with remote server works.. what does the command line supposed to mean anyway? – kwagjj Jun 25 '14 at 12:06xhost
gave us any clue on the exact value of the MIT-MAGIC-COOKIES. still wondering why the hell the value of these cookies are different. – kwagjj Jun 25 '14 at 13:42