Bad package length

Matt Johnston matt at ucc.asn.au
Mon Nov 14 17:05:34 WST 2005


On Mon, Nov 14, 2005 at 03:45:01AM -0500, Li, Aubrey wrote:
> Hi all,
> 
> After ported dropbear to my target board, I run dropbear in the
> INETD_MODE.
> I got the following error message when I ssh to my target board:
> - - - - - - - -
> ssh 192.168.0.15
> Disconnecting: Bad packet length 1530147165.
> - - - - - - - -
> ./configure --disable-zlib --disable-wtmp --disable-openpty
> --disable-wtmpx --disable-syslog --disable-shadow --disable-lastlog
> --disable-utmp --disable-utmpx
>
>       "ssh stream tcp nowait root /bin/dropbear -i"

This packet length is 5B34315D in hex, which corresponds to

0000000: 5b34 315d                                [41]

That looks like the standard-error log output that Dropbear
gives when syslog is disabled, like
"[41] Nov 14 16:51:40 Not forking" etc.

Some inetds do put standard-error out the network socket,
and some don't - I'm not exactly sure what the expected
behaviour should be (if anyone knows, could you share? :)

So for your situation, the best bet is either (in vague
order of preference):

1) Compile with syslog enabled (if no syslogd is running, it
won't matter and nothing will get logged)

or

2) Edit svr-session.c and comment out the line 
fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf);

or

3) Make a wrapper script that runs dropbear but redirects
stderr somewhere else, ala
dropbear -i 2> /dev/null


Since stderr logging doesn't really make sense for inetd
mode, I'll disable it in the next release.

Let me know if that doesn't fix things.

Cheers,
Matt


More information about the Dropbear mailing list