WARNING: /etc/ssh/moduli does not exist, using fixed modulus

debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT

Received disconnect from 71.246.225.60: 3: java.security.InvalidAlgorithmParamet

erException: Prime size must be multiple of 64, and can only range from 512 to 1

024 (inclusive)

This says it all: you don't have a 'moduli' file from which to pick a suitable prime number, so it's choosing from some builtin default value. However, the value it's using doesn't meet the client's criteria because it's (likely) too big.

The solution is to build a 'moduli' file with prime numbers of the right size (bit-width). The process is described here:

http://manpages.ubuntu.com/manpages/xenial/en/man1/ssh-keygen.1.html#contenttoc3I used the example commands exactly as-is to generate 2048-bit prime numbers. The first run generated 57,003 "candidates" in a bit over 5 minutes. The second run took 47 minutes to confirm that 12 of them were in fact genuine prime numbers. Repeating this process using a bit-width in the range of 512 to 1024 should be a lot faster.

Note: I suspect that primes of "only" 512-1024 bits is probably considered low-end these days. Rather than being locked into a specific bit-width for all applications, you may want to run the generation process multiple times specifying differing widths, then combine the various output files into a single 'moduli' file.

UPDATE: I was just looking at the OpenSSH package from NetLabs and found that it has a ready-to-use moduli file with bit-widths from 1024 to 8192. A zip of the file is attached.