4

With ssh, I can do something like the following:

ssh user@host -t /path/to/some/shell

How can I automatically launch a shell on the server with mosh?

I have tried with

mosh user@host -ssh /path/to/some/shell

and with:

mosh user@host -ssh "ssh -t /path/to/some/shell"

with no luck. Is this at all possible?

Amelio Vazquez-Reina
  • 40,169
  • 77
  • 197
  • 294

1 Answers1

6

Try:

mosh user@host -- /path/to/some/shell

The general form is:

mosh [options] -- user@host [command]

If you don't specify a command, mosh spawn a login shell by default.

cuonglm
  • 150,973
  • 38
  • 327
  • 406
  • Thanks. Any way to pass commands as well? That is, e.g. doing `ssh -t machine@domain 'export STARTUP_OPTION="A"; exec /path/to/zsh'` but with `mosh` (see [this Q&A](http://unix.stackexchange.com/questions/234393/passing-variable-definitions-to-specific-shells-in-ssh) for more context) – Amelio Vazquez-Reina Oct 08 '15 at 18:20
  • I tried with `mosh user@host -- "export LC_OPTION=A; /path/to/some/shell"` without luck. – Amelio Vazquez-Reina Oct 08 '15 at 18:21