• PuTTY using a different localhost than specified

    From sgerardengle@gmail.com@21:1/5 to All on Wed Oct 9 12:30:50 2019
    Hello,

    I have students that are using PuTTY for X-forwarding from a remote Linux cluster. They specify the X display location as localhost:0.0, but whenever they try ti display a new window or graphic, they keep getting an error that localhost:20.0 or localhost:
    17.0 can't be connected to.

    Is there some other setting that I'm missing, or a file somewhere that is redirecting to a different localhost address?

    Thank you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to sgerardengle@gmail.com on Wed Oct 9 21:23:47 2019
    On 10/9/19 1:30 PM, sgerardengle@gmail.com wrote:
    Hello,

    Hi,

    I have students that are using PuTTY for X-forwarding from a remote
    Linux cluster. They specify the X display location as localhost:0.0,
    but whenever they try ti display a new window or graphic, they keep
    getting an error that localhost:20.0 or localhost:17.0 can't be
    connected to.

    Is there some other setting that I'm missing, or a file somewhere
    that is redirecting to a different localhost address?

    I have no idea if it's what you're getting hit by or not, but I've been
    hit by something quite similar.

    TL;DR: localhost is ambiguous when you have IPv4 and IPv6 on the client
    and / or server.

    Work around: explicitly specify "127.0.0.1" or "::1" instead of the
    name "localhost".

    Thank you.

    You're welcome.

    I hope that helps.



    --
    Grant. . . .
    unix || die

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Per Hedeland@21:1/5 to sgerardengle@gmail.com on Fri Oct 11 14:42:11 2019
    In article <bc9c0562-0e81-4b7d-a79a-128fef7cc81f@googlegroups.com> sgerardengle@gmail.com writes:

    I have students that are using PuTTY for X-forwarding from a remote
    Linux cluster. They specify the X display location as localhost:0.0, but >whenever they try ti display a new window or graphic, they keep getting
    an error that localhost:20.0 or localhost:17.0 can't be connected to.

    Those different values are to be expected - the SSH server listens on
    a TCP port that must be different from the ones used by any X servers
    running on that host, and different from the ones used by other X
    forwardings. The OpenSSH server has a config parameter for it:

    X11DisplayOffset
    Specifies the first display number available for sshd(8)'s X11
    forwarding. This prevents sshd from interfering with real X11
    servers. The default is 10.

    So, the first SSH connection with X forwarding will make the SSH
    server set the environment $DISPLAY to localhost:10.0, which
    corresponds to TCP port 6010 on the server host, the next one
    localhost:11.0 / port 6011 and so on. X clients started on the server
    host will connect to the SSH server according to $DISPLAY, the
    connection is forwarded to the SSH client, which connects to the
    actual X server, typically based on the $DISPLAY setting on the client
    host.

    And I think *this* is where your problem is - I'm not familiar with
    PuTTY, but I assume that's where you specify "localhost:0.0". IMHO,
    this shouldn't be needed, PuTTY should at least by default use the
    $DISPLAY setting - and localhost:0.0, which means "connect to TCP port
    6000", probably doesn't work, since the X server doesn't listen for
    TCP connections by default.

    In fact I can reproduce your problem with the OpenSSH client, which
    *only* uses $DISPLAY. With my default setting of $DISPLAY, i.e.
    ":0.0", which means "connect via unix domain socket", X forwarding
    works just fine, but

    client $ export DISPLAY=localhost:0.0
    client $ ssh -X server
    ...
    server $ xterm
    connect localhost port 6000: Connection refused
    xterm: Xt error: Can't open display: localhost:12.0
    server $

    (The first line is from the OpenSSH client, failing to connect to "localhost:0.0", while the second one is from xterm on the server.)

    Is there some other setting that I'm missing

    Try not specifying an X display for PuTTY at all, maybe it will then
    use $DISPLAY - or, check your $DISPLAY value (probably ":0.0"), and
    specify that for PuTTY.

    --Per Hedeland

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)