Friday, November 8, 2024

homebrew – “Command not discovered: mosh-server” when attempting to connect with macOS server working mosh

I am attempting to connect with an M2 Mac mini with mosh.

Nevertheless, when connecting with mosh <hostname>, I get an error zsh:1: command not discovered: mosh-server:

$ mosh <username>@<hostname>                                     
(<username>@<hostname>) Password:
zsh:1: command not discovered: mosh-server
Connection to m2-mini.native closed.
/decide/homebrew/bin/mosh: Didn't discover mosh server startup message. (Have you ever put in mosh in your server?)

I positively have put in mosh on that server. After I ssh in, and run which mosh-server I get /decide/homebrew/bin/mosh-server:

<username>@<local_hostname> ~ % ssh <username>@<remote_hostname>
...
<username>@<remote_hostname> ~ % which mosh-server
/decide/homebrew/bin/mosh-server

A workaround is to run:

mosh [email protected] --server /decide/homebrew/bin/mosh-server

however this should not be obligatory?

Curiously, once I run a distant command with ssh -t, I get “mosh-server not discovered”:

<username>@<local_hostname> ~ % ssh [email protected] -t which mosh-server
(<username>@<remote_hostname) Password:
mosh-server not discovered
Connection to <remote_hostname> closed.

What is going on on right here?

Replace:

This might need to do one thing with the kind of shell that is loaded. I get for instance:

$ ssh <username>@<remote_hostname> -t 'echo $PATH'
/usr/bin:/bin:/usr/sbin:/sbin

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles