ssh hangs if the command is larger than 1374 bytes

Solution 1:

It seems to be not SSH problem, but the problem of your network, or rather it MTU settings. Such problem described in detail here.