Last week, after I upgraded an ISR4K to version 17.12.64, we encountered an issue where, after entering the password while SSH to the router, i received the error below.

There was not much information specific to Cisco about why this occurred. However, there was generic information on the internet regarding this error, which did not help us in resolving the problem.
As a last resort, we planned to open a TAC case, and when I had the opportunity to speak with someone at Cisco, they asked me to try the following command:
conf t
no ip ssh bulk-mode
That resolved our issue.
Diving deeper, starting from Cisco IOS XE Dublin 17.10.1, ip ssh bulk-mode is enabled by default, which was causing the issue for us.
So, what does ip ssh bulk-mode do?
(I’ve copied the information below from the Configurations Guide)
Secure Copy Performance Improvements
SSH bulk data transfer mode can be used to enhance the throughput performance of SCP that is operating in the capacity of a client or a server. Beginning from Cisco IOS XE Dublin 17.10.1, SSH bulk data transfer mode is enabled by default with default window size of 128KB. TCP selective acknowledgement (SACK) is enabled by default if the bulk mode window size is configured.
The default bulk mode window size of 128 KB is optimal to copy large files in most network settings. However, in long big networks where the round-trip time (RTT) is high, 128 KB is not enough. You can enable the most optimal SCP throughput performance by configuring the bulk mode window size using the ip ssh bulk-mode window-size command. For example, in an ideal lab testing environment, a window size of 2 MB in a 200-milliseconds round-trip time setting can give around 500 percent improved throughput performance when compared to the default 128-KB window size.
The bulk mode window size must be configured as per the network bandwidth-delay product, that is, a multiple of total available bandwidth in bits per second and the round-trip time in seconds. Because the CPU usage may increase with the increased window size, make sure to balance this by choosing the right window size.