How to run "cd" command and keep ssh session in mosh

338 Views Asked by At

In ssh, I can use ssh root@myhost -t "cd mydir; bash -i" to do that, how can I run 2 commands in mosh with one line

1

There are 1 best solutions below

5
Jakuje On

According to man mosh(1), you can do the same with mosh, but you need to add the -t option to the ssh:

mossh root@myhost --ssh="ssh -t" "cd mydir; bash -i"