{
    "mode": "man",
    "parameter": "moduli",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/moduli/5/json",
    "generated": "2026-09-20T05:00:44Z",
    "sections": {
        "NAME": {
            "content": "moduli — Diffie-Hellman moduli\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  /etc/ssh/moduli  file  contains  prime  numbers and generators for use by sshd(8) in the\nDiffie-Hellman Group Exchange key exchange method.\n\nNew moduli may be  generated  with  ssh-keygen(1)  using  a  two-step  process.   An  initial\ncandidate  generation  pass, using ssh-keygen -M generate, calculates numbers that are likely\nto be useful.  A second primality testing pass, using ssh-keygen -M screen, provides  a  high\ndegree  of assurance that the numbers are prime and are safe for use in Diffie-Hellman opera‐\ntions by sshd(8).  This moduli format is used as the output from each pass.\n\nThe file consists of newline-separated records, one per modulus, containing seven space-sepa‐\nrated fields.  These fields are as follows:\n\ntimestamp    The time that the modulus was last processed as YYYYMMDDHHMMSS.\n\ntype         Decimal number specifying the internal structure  of  the  prime  modulus.\nSupported types are:\n\n0     Unknown, not tested.\n2     \"Safe\" prime; (p-1)/2 is also prime.\n4     Sophie Germain; 2p+1 is also prime.\n\nModuli  candidates  initially produced by ssh-keygen(1) are Sophie Germain\nprimes (type 4).  Further primality testing  with  ssh-keygen(1)  produces\nsafe prime moduli (type 2) that are ready for use in sshd(8).  Other types\nare not used by OpenSSH.\n\ntests        Decimal  number indicating the type of primality tests that the number has\nbeen subjected to represented as a bitmask of the following values:\n\n0x00  Not tested.\n0x01  Composite number – not prime.\n0x02  Sieve of Eratosthenes.\n0x04  Probabilistic Miller-Rabin primality tests.\n\nThe ssh-keygen(1) moduli candidate generation uses the  Sieve  of  Eratos‐\nthenes  (flag 0x02).  Subsequent ssh-keygen(1) primality tests are Miller-\nRabin tests (flag 0x04).\n\ntrials       Decimal number indicating the number of primality trials  that  have  been\nperformed on the modulus.\n\nsize         Decimal number indicating the size of the prime in bits.\n\ngenerator    The recommended generator for use with this modulus (hexadecimal).\n\nmodulus      The modulus itself in hexadecimal.\n\nWhen  performing Diffie-Hellman Group Exchange, sshd(8) first estimates the size of the modu‐\nlus required to produce enough Diffie-Hellman output to sufficiently key the selected symmet‐\nric cipher.  sshd(8) then randomly selects a modulus from /etc/ssh/moduli that best meets the\nsize requirement.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ssh-keygen(1), sshd(8)\n",
            "subsections": []
        },
        "STANDARDS": {
            "content": "M. Friedl, N. Provos, and W. Simpson, Diffie-Hellman Group  Exchange  for  the  Secure  Shell\n(SSH) Transport Layer Protocol, RFC 4419, March 2006.\n\nDebian                                     April 16, 2022                                  MODULI(5)",
            "subsections": []
        }
    },
    "summary": "moduli — Diffie-Hellman moduli",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "ssh-keygen",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh-keygen/1/json"
        },
        {
            "name": "sshd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sshd/8/json"
        }
    ]
}