Mosh: Problem running mosh-server on OS X

Created on 30 Aug 2013  路  7Comments  路  Source: mobile-shell/mosh

I installed Mosh on an iMac:

鉃も灓 uname -a
Darwin A-iMac.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
鉃も灓 brew info mobile-shell
mobile-shell: stable 1.2.4, HEAD
http://mosh.mit.edu/
/usr/local/Cellar/mobile-shell/1.2.4 (12 files, 1004K) *
  Built from source
https://github.com/mxcl/homebrew/commits/master/Library/Formula/mobile-shell.rb
==> Dependencies
Build: pkg-config
Required: protobuf
鉃も灓 mosh-server

MOSH CONNECT 60001 Ce2m7BF/apQu8mwPVcxFJA

mosh-server (mosh 1.2.4)
Copyright 2012 Keith Winstein <[email protected]>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 11214]

and try to connect from my Macbook(10.8.4, Mosh works well here):

鉃も灓 uname -a
Darwin C-Air.local 12.4.1 Darwin Kernel Version 12.4.1: Tue May 21 17:04:50 PDT 2013; root:xnu-2050.40.51~1/RELEASE_X86_64 x86_64
鉃も灓 mosh [email protected]
Password:
bash: mosh-server: command not found
Connection to 192.168.1.11 closed.
/usr/local/bin/mosh: Did not find mosh server startup message.

Then I went back to check on iMac, there was a mosh-server running (soon it disappeard, though):

鉃も灓 ps aux | grep mosh
C          11271   0.0  0.0  2432768    596 s001  R+    6:33PM   0:00.00 grep mosh
C          11266   0.0  0.0  2434268   1500 s001  S     6:33PM   0:00.00 mosh-server

That's strange. Doesn't Mosh server work on OS X?

Most helpful comment

OMG IT WORKS! Thanks!
Solution for OSX is (on remote host under ssh login user):

echo "export PATH=$PATH:/usr/local/bin" >> ~/.bashrc

All 7 comments

mosh-server is an internal command that you should never run yourself. The mosh client will take care of running it on the server for you. However, mosh needs to know where to find it on the server. You can do this either by making sure mosh-server is in your PATH, or by passing the --server=/path/to/mosh-server option to mosh.

@andersk You are right. It works now with --server= parameter.

鉃も灓 mosh [email protected]
Password:
bash: mosh-server: command not found
Connection to 192.168.1.11 closed.
/usr/local/bin/mosh: Did not find mosh server startup message.
鉃も灓 mosh [email protected] --server=/usr/local/bin/mosh-server
Password:


[mosh is exiting.]

But what I'm still confused about is mosh-server is in my $PATH, why that happened?

A-iMac:~ C$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Same problem. I have OSX Mavericks and mosh installed via brew ($ brew install mosh).
But I still can't connect to my Mac with mosh without --server=/usr/bin/local/mosh-server

Your PATH appears to be set differently in interactive and noninteractive shells. Try these commands to see the difference:

ssh SERVER
echo "$PATH"

and

ssh SERVER 'echo "$PATH"'

OMG IT WORKS! Thanks!
Solution for OSX is (on remote host under ssh login user):

echo "export PATH=$PATH:/usr/local/bin" >> ~/.bashrc

Had the same problem with zsh, need to set path in .zshenv
http://zsh.sourceforge.net/Intro/intro_3.html

use
echo "export PATH=$PATH:/usr/local/bin" >> ~/.zshenv
resolved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skrat picture skrat  路  4Comments

earlchew picture earlchew  路  5Comments

a-b picture a-b  路  6Comments

Shoozza picture Shoozza  路  7Comments

shibumi picture shibumi  路  5Comments