mobile-shell / mosh

Mobile Shell
https://mosh.org
GNU General Public License v3.0
12.44k stars 727 forks source link

mosh fails to connect to server in ssh config with ProxyCommand option set #1260

Closed m12znet closed 1 year ago

m12znet commented 1 year ago

Hi there! Seeing if you all can help me connect to a remote dev server I have set up through coder. When I try to connect with:

mosh coder.marcos-linux-dev.main

I get the following:

/opt/homebrew/bin/mosh: could not get canonical name for coder.marcos-linux-dev.main: nodename nor servname provided, or not known
kex_exchange_identification: Connection closed by remote host
/opt/homebrew/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).

This is the contents of the the ssh config:

# ------------START-CODER-----------
# This section is managed by coder. DO NOT EDIT.
#
# You should not hand-edit this section unless you are removing it, all
# changes will be lost when running "coder config-ssh".
#
Host coder.marcos-linux-dev
    HostName coder.marcos-linux-dev
    ConnectTimeout=0
    StrictHostKeyChecking=no
    UserKnownHostsFile=/dev/null
    LogLevel ERROR
    ProxyCommand /usr/local/bin/coder --global-config "/Users/mmartinez/Library/Application Support/coderv2" ssh --stdio marcos-linux-dev
Host coder.marcos-linux-dev.main
    HostName coder.marcos-linux-dev.main
    ConnectTimeout=0
    StrictHostKeyChecking=no
    UserKnownHostsFile=/dev/null
    LogLevel ERROR
    ProxyCommand /usr/local/bin/coder --global-config "/Users/mmartinez/Library/Application Support/coderv2" ssh --stdio marcos-linux-dev.main
# ------------END-CODER------------

Any tip on how to resolve this? Is this configuration compatible with mosh? Thank you very much in advanced!

achernya commented 1 year ago

Mosh doesn't support ProxyCommand. There's an open feature request (#285). So marking this as a duplicate.