standard ssh to erlang sshd gives default shell, not the one specified in ssh:daemon/3

andrei zavada <>
Mon Jul 26 17:32:16 CEST 2010


Consider the case of starting ssh:daemon/3 with bespoke shell supplied as
{shell, {Module, Function, Args}} in the proplist as its third parameter.

Everything works as expected if I just do (using openssh-5.5_p1, the current
version in Gentoo per this writing)

$ ssh -p<port> localhost

My shell is now invoked and is happily serving commands.  Once I try the same
with a command-line parameter, i.e.,

$ ssh -p<port> localhost fafa

(expecting "fafa" to be passed to my shell function), the server hands "fafa"
over to the Erlang standard shell, which prints:

{error,{1,erl_parse,["syntax error before: ",[]]}}

And, logically, appending a dot to "fafa" makes it a valid Erlang expression,
which gets me a nice


The expected behaviour is that sshd accept the command and feed it to the
custom shell the user specified in the Options proplist.

This misbehaviour is verified in otp-12B-5, otp-13B04, as well as in otp-14A.
All systems were tested on a Gentoo box (~amd64 arch), built from unpatched
sources from

Is this a bug, as I suppose it is?

Andrei Zavada

More information about the erlang-bugs mailing list