SSH: Protocol error: expected packet type 50, got -1

Unanswered Question
Aug 13th, 2009

I see this error during one of many automated script activities:

Received disconnect from [IOS router IP addr]: 2: Protocol error: expected packet type 50, got -1

Just curious what could've caused this.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Thu, 08/13/2009 - 16:31

Most likely the router disconnected unexpectedly. Packet 50 (in SSHv2) is SSH2_MSG_USERAUTH_REQUEST, meaning request for user authentication. Sometimes, if the credentials are wrong, IOS immediately disconnects instead of letting you try again.

We see this with RME when DCR has bad credentials for certain devices (typically autonomous APs).

yjdabear Wed, 08/19/2009 - 07:36

In my case, it appears it's because the further-down-the-list target hosts of many simultaneously spawned SSH sessions have timed out waiting for user input (such as entering a password), but SSH doesn't actually disconnect (packet type -1) until the "user" has gotten around to sending that input. It particularly manifests itself with any OS using a relatively short SSH timeout value--I have to set Expect timeout to the smallest value possible, in order to process through a full list of not that many Aruba hosts, in parallel, without getting disconnected by the ones at the end of the list. It's not as obvious with IOS, presumably due to a longer timeout value.


This Discussion