I think you can achieve the &quot;best&quot; outcome as follows.<div><br></div><div>(1) sshd forces the user to run a particular command, e.g. with the ForceCommand mechanism or &quot;command=&quot; in authorized_keys. This command is a script that works as follows.</div>

<div><br></div><div>(2) The script checks to see what the user-requested command is (stored in the SSH_ORIGINAL_COMMAND environment variable).</div><div><br></div><div>(3a) If SSH_ORIGINAL_COMMAND is blank or doesn&#39;t contain &quot;mosh-server&quot;, the script runs the BBS program. End.</div>

<div><br></div><div>(3b) If SSH_ORIGINAL_COMMAND contains &quot;mosh-server&quot;: </div><div><br></div><div>(4) The script scans the command-line and collects the -s, -i, -p, and -c arguments, if any.</div><div><br></div>

<div>(5) The script then runs mosh-server new [args] -- bbs_program. End.</div><div><br></div><div>Another option is just to edit the mosh-server source code to just hardcode the BBS program as the thing it runs (ignoring any command-line argument or the user&#39;s shell).</div>

<div><br></div><div>Hope this helps. Cheers,</div><div>Keith</div><div><br></div><div><div class="gmail_quote">On Sun, Aug 4, 2013 at 11:13 PM, Gordon Morehouse <span dir="ltr">&lt;<a href="mailto:gordon@morehouse.me" target="_blank">gordon@morehouse.me</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<br>
<br>
I have an old BBS program that allows ssh login by means of simply<br>
executing it as the user&#39;s shell; this presents problems for mosh users.<br>
<br>
I&#39;m wondering how to work around it.<br>
<br>
Best: mosh users connect to the same <a href="mailto:user@domain.com">user@domain.com</a> as everyone else<br>
<br>
Good: mosh users connect to a different <a href="mailto:user2@domain.com">user2@domain.com</a>, mosh starts<br>
      up, then they immediately must execute the BBS shell with no<br>
      chance to &#39;escape&#39; (eg, run a real shell)<br>
<br>
Any other possibilities?<br>
<br>
Ways to run certain programs (eg mosh-server) and *then* weird shells or<br>
a set program that (in general) doesn&#39;t allow the user to escape to a<br>
real shell?<br>
<br>
Thanks much,<br>
-Gordon M.<br>
_______________________________________________<br>
mosh-users mailing list<br>
<a href="mailto:mosh-users@mit.edu">mosh-users@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/mosh-users" target="_blank">http://mailman.mit.edu/mailman/listinfo/mosh-users</a><br>
</blockquote></div><br></div>