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?

5

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.

  • 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 for more context) – Amelio Vazquez-Reina Oct 8 '15 at 18:20
  • I tried with mosh user@host -- "export LC_OPTION=A; /path/to/some/shell" without luck. – Amelio Vazquez-Reina Oct 8 '15 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.