Re: X11 article, for review (take 2)
Re: X11 article, for review (take 2)
- Subject: Re: X11 article, for review (take 2)
- From: Aaron Harwood <email@hidden>
- Date: Tue, 1 Apr 2003 23:31:54 +1000
On Tuesday, April 1, 2003, at 05:26 PM, Rich Morin wrote:
If these things confuse you, then you'd better write more explicitly
your
problem with reference to the "local" (client) machine and the
"remote"
(server) machine.
Your terminology is confusing me, but then X11's terminology is rather
confusing, to begin with. So, I will define my terms:
As I understand it, an X11 "client" is a program that may run
anywhere,
but its interactive I/O (e.g., pixels and mouse clicks) is routed to
an
X11 "server" which (normally) runs on the machine in front of the
user.
This being the case, it's less confusing (to me, at least) to speak
of
the "desktop" machine and the "remote" machine than to try to use the
(overloaded) words "client" and "server".
To view the following, you'd better set your font to fixed width (e.g.
courier).
Local Machine <------------------> Remote Machine
ssh client (ssh) ssh server (sshd)
X server X client (e.g. xclock)
ssh_config file is sshd_config file is
relevant here relevant here
That said, I'm not setting $DISPLAY on the remote machine; ssh does
that
for me if $DISPLAY is defined on the desktop machine. I set $DISPLAY
in
my .login file on the desktop machine, if it isn't set already:
if !($?DISPLAY) setenv DISPLAY ':0.0'
As I understand it, ssh and sshd conspire to turn this setting on my
desktop machine into a setting on the remote machine (pointing to a X11
proxy, again on the remote machine). Is any of this incorrect?
The sshd will set the DISPLAY variable to a number with an offset given
by
X11DisplayOffset 10
in sshd_config (default at value 10). In the example below I have
ssh'ed to
the machine callisto from home. Then I echo $DISIPLAY, see that it is
one
plus the offset given by X11DisplayOffset (that's because display 10 is
already
being used by another user). Also I use netstat | head -5 to view the
first five
lines of the netstat command stardard output. See that port number 6011
is listening
for connections. An X client will look at the value of $DISPLAY and
connect to port
obtained by adding 6000 to the value of $DISPLAY (in this case port
6011).
The sshd is listening on port 6011 and when the X client attempts to
connect
the sshd signals the ssh back
on the local machine which in turn contacts the X server and a
connection
is made between the X client and the X server, with the sshd/ssh
processes working
to forward data in both directions. In effect, X client thinks it is
talking to
an X server on the remote machine, but actually its talking to the X
server on
the local machine.
[callisto:~] aharwood% echo $DISPLAY
localhost:11.0
[callisto:~] aharwood% netstat | head -5
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address
(state)
tcp4 0 0 localhost.6011 *.*
LISTEN
tcp4 0 0 callisto.cs.mu.o.ssh aharwood.ppp.cs..49361
ESTABLISHED
tcp4 0 0 localhost.2525 localhost.51502
ESTABLISHED
[callisto:~] aharwood%
Hope this helps :-)
--Aaron
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.