Mosh: brew installed, bash: mosh-server: command not found...

Created on 24 Apr 2012  路  8Comments  路  Source: mobile-shell/mosh

installed the latest version, 1.1.3, tried to run mosh username@server-path, and entered the password, keep receiving the error message: bash: mosh-server: command not found... but checked and pretty sure that mosh-server and mosh-client were installed in the same directory, /usr/local/bin as well.

Most helpful comment

Since this closed issue seems to be a popular place to go for people with similar symptoms: if you are seeing a message like mosh-server: command not found, you need to make sure that

  1. The mosh-server command is installed on the server,
  2. The mosh-server command is in your server鈥檚 PATH, and
  3. The mosh-server command is _still_ in your server鈥檚 PATH if you run it directly from the SSH command line. Try these commands:
ssh HOSTNAME 'mosh-server --help'
````

or

ssh HOSTNAME 'echo $PATH'
```

It seems that some systems satisfy (2) but not (3), perhaps because PATH is not being set in the right dotfiles. (I wouldn鈥檛 blame you鈥攚hich dotfiles are executed where can be a confusing system-dependent mess.)

If you don鈥檛 want to fix your dotfiles, you can work around this by passing the --server option: mosh --server=/full/path/to/mosh-server HOSTNAME.

All 8 comments

Hello. Have you installed mosh on the server?

oh, should I? that's like a foolishest mistake, didn't see it in the usage description... would you mind point me to the right introduction page? and then this could be closed.

No worries. FWIW, we do discuss this in the README on the front page (https://github.com/keithw/mosh): "Usage: The mosh-client binary must exist on the user's machine, and the mosh-server binary on the remote host."

Please open a new ticket if you have trouble, and thanks for using mosh!

For the record/anyone who finds this one as a search result:
If this happens to you on Gentoo, enable the 'server' USE-flag for the net-misc/mosh package and re-emerge it then.

@keithw Is it possible the error message could be made more clear, to explain where the problem is coming from?

I have the same problem.
I've installed mosh-server on my host machine via mac ports, and I get the same error.
I've tried manually doing
~ mosh-server,
something pops up giving me

MOSH CONNECT 60001 [hidden key]

mosh-server (mosh 1.2.4
[license info]

[mosh-server detached, pid = [pid]]

What's going on?

Same problem here, I can ssh into the Mac and type mosh-server and everything looks as iamchanghyunpark describes. Then when I ssh in using Mosh-Client for Google Chrome, I get

Bad response when running mosh-server: 'bash: mosh-server: command not found

(brew install mobile-shell)

QUICK FIX:

1) Create this script called mymosh in your home folder:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
/usr/local/bin/mosh-server

2) Chmod mymosh to 777

3) In the Google Chrome App extension, when putting your settings, put into the setting for "Mosh Server Command" the following:
./mymosh

For me, this worked.

Since this closed issue seems to be a popular place to go for people with similar symptoms: if you are seeing a message like mosh-server: command not found, you need to make sure that

  1. The mosh-server command is installed on the server,
  2. The mosh-server command is in your server鈥檚 PATH, and
  3. The mosh-server command is _still_ in your server鈥檚 PATH if you run it directly from the SSH command line. Try these commands:
ssh HOSTNAME 'mosh-server --help'
````

or

ssh HOSTNAME 'echo $PATH'
```

It seems that some systems satisfy (2) but not (3), perhaps because PATH is not being set in the right dotfiles. (I wouldn鈥檛 blame you鈥攚hich dotfiles are executed where can be a confusing system-dependent mess.)

If you don鈥檛 want to fix your dotfiles, you can work around this by passing the --server option: mosh --server=/full/path/to/mosh-server HOSTNAME.

Was this page helpful?
0 / 5 - 0 ratings