{
    "content": [
        {
            "type": "text",
            "text": "# moduli(5) (man)\n\n**Summary:** moduli — Diffie-Hellman moduli\n\n## See Also\n\n- ssh-keygen(1)\n- sshd(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (52 lines)\n- **SEE ALSO** (2 lines)\n- **STANDARDS** (4 lines)\n\n## Full Content\n\n### NAME\n\nmoduli — Diffie-Hellman moduli\n\n### DESCRIPTION\n\nThe /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 candidate\ngeneration pass, using ssh-keygen -G, calculates numbers that are likely to be useful.  A sec‐\nond primality testing pass, using ssh-keygen -T, provides a high degree of assurance that the\nnumbers are prime and are safe for use in Diffie-Hellman operations by sshd(8).  This moduli\nformat 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.  Sup‐\nported 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 safe\nprime moduli (type 2) that are ready for use in sshd(8).  Other types are\nnot 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 Eratosthenes\n(flag 0x02).  Subsequent ssh-keygen(1) primality tests are Miller-Rabin\ntests (flag 0x04).\n\ntrials       Decimal number indicating the number of primality trials that have been per‐\nformed 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 modulus\nrequired to produce enough Diffie-Hellman output to sufficiently key the selected symmetric ci‐\npher.  sshd(8) then randomly selects a modulus from /etc/ssh/moduli that best meets the size\nrequirement.\n\n### SEE ALSO\n\nssh-keygen(1), sshd(8)\n\n### STANDARDS\n\nM. Friedl, N. Provos, and W. Simpson, Diffie-Hellman Group Exchange for the Secure Shell (SSH)\nTransport Layer Protocol, RFC 4419, March 2006 2006.\n\nBSD                           September 26, 2012                           BSD\n\n"
        }
    ],
    "structuredContent": {
        "command": "moduli",
        "section": "5",
        "mode": "man",
        "summary": "moduli — Diffie-Hellman moduli",
        "synopsis": null,
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 52,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "STANDARDS",
                "lines": 4,
                "subsections": []
            }
        ]
    }
}