There are concepts of maigc cookies, .Xautority file ( creating a Proxy X server) etc.. discussed in the following blog.It is very good blog on how to use User A's display to display from User B in Unix.
A@hostB => sudo su - B
Password:
[~]
B@hostB => xclock
X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).
[~]
B@hostB =>
No luck. The reason this didn’t work is that user “B” doesn’t have
the proper authority to display on another user’s display. Remember
that X uses an access control mechanism to allow client to write to a
display. Unlike the host-based access that we touched on above, X can
also use a more secure control mechanism called a “magic cookie”. This
cookie allows a user to gain access to a display. By default, these cookies are stored in a file named
.Xauthority
.
Recall that when we used the X forwarding capabilities of SSH it
created a “proxy” X server. Part of the creation of that proxy is the
creation of an
.Xauthority
file to manage the connections to that proxy server. When we created the initial SSH connection with the -X
option, “hostB” created a proxy X server with a .Xauthority
file in the user’s home directory and added a cookie for the new connection.. Please refer to above link for more info..
No comments:
Post a Comment