{
    "content": [
        {
            "type": "text",
            "text": "# chage (man)\n\n## NAME\n\nchage - change user password expiry information\n\n## SYNOPSIS\n\nchage [options] LOGIN\n\n## DESCRIPTION\n\nThe chage command changes the number of days between password changes and the date of the\nlast password change. This information is used by the system to determine when a user must\nchange their password.\n\n## TLDR\n\n> Change user account and password expiry information.\n\n- List password information for the user:\n  `chage {{-l|--list}} {{username}}`\n- Enable password expiration in 10 days:\n  `sudo chage {{-M|--maxdays}} {{10}} {{username}}`\n- Disable password expiration:\n  `sudo chage {{-M|--maxdays}} {{1}} {{username}}`\n- Set account expiration date:\n  `sudo chage {{-E|--expiredate}} {{YYYY-MM-DD}} {{username}}`\n- Force user to change password on next log in:\n  `sudo chage {{-d|--lastday}} {{0}} {{username}}`\n- Re-enable an account:\n  `sudo chage {{-E|--expiredate}} -1 {{username}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (10 subsections)\n- **NOTE**\n- **CONFIGURATION**\n- **FILES**\n- **EXIT VALUES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "chage",
        "section": "",
        "mode": "man",
        "summary": "chage - change user password expiry information",
        "synopsis": "chage [options] LOGIN",
        "tldr_summary": "Change user account and password expiry information.",
        "tldr_examples": [
            {
                "description": "List password information for the user",
                "command": "chage {{-l|--list}} {{username}}"
            },
            {
                "description": "Enable password expiration in 10 days",
                "command": "sudo chage {{-M|--maxdays}} {{10}} {{username}}"
            },
            {
                "description": "Disable password expiration",
                "command": "sudo chage {{-M|--maxdays}} {{1}} {{username}}"
            },
            {
                "description": "Set account expiration date",
                "command": "sudo chage {{-E|--expiredate}} {{YYYY-MM-DD}} {{username}}"
            },
            {
                "description": "Force user to change password on next log in",
                "command": "sudo chage {{-d|--lastday}} {{0}} {{username}}"
            },
            {
                "description": "Re-enable an account",
                "command": "sudo chage {{-E|--expiredate}} -1 {{username}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-d",
                "long": "--lastday",
                "arg": null,
                "description": "Set the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area)."
            },
            {
                "flag": "-E",
                "long": "--expiredate",
                "arg": null,
                "description": "Set the date or number of days since January 1, 1970 on which the user's account will no longer be accessible. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again. Passing the number -1 as the EXPIREDATE will remove an account expiration date."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help message and exit."
            },
            {
                "flag": "-i",
                "long": "--iso8601",
                "arg": null,
                "description": "When printing dates, use YYYY-MM-DD format."
            },
            {
                "flag": "-I",
                "long": "--inactive",
                "arg": null,
                "description": "Set the number of days of inactivity after a password has expired before the account is locked. The INACTIVE option is the number of days of inactivity. A user whose account is locked must contact the system administrator before being able to use the system again. Passing the number -1 as the INACTIVE will remove an account's inactivity."
            },
            {
                "flag": "-l",
                "long": "--list",
                "arg": null,
                "description": "Show account aging information."
            },
            {
                "flag": "-m",
                "long": "--mindays",
                "arg": null,
                "description": "Set the minimum number of days between password changes to MINDAYS. A value of zero for this field indicates that the user may change their password at any time."
            },
            {
                "flag": "-M",
                "long": "--maxdays",
                "arg": null,
                "description": "Set the maximum number of days during which a password is valid. When MAXDAYS plus LASTDAY is less than the current day, the user will be required to change their password before being able to use their account. This occurrence can be planned for in advance by use of the -W option, which provides the user with advance warning. Passing the number -1 as MAXDAYS will remove checking a password's validity."
            },
            {
                "flag": "-R",
                "long": "--root",
                "arg": null,
                "description": "Apply changes in the CHROOTDIR directory and use the configuration files from the CHROOTDIR directory."
            },
            {
                "flag": "-W",
                "long": "--warndays",
                "arg": null,
                "description": "Set the number of days of warning before a password change is required. The WARNDAYS option is the number of days prior to the password expiring that a user will be warned their password is about to expire. If none of the options are selected, chage operates in an interactive fashion, prompting the user with the current values for all of the fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a pair of [ ] marks."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "passwd",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/passwd/5/json"
            },
            {
                "name": "shadow",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/shadow/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-d --lastday",
                        "lines": 4,
                        "flag": "-d",
                        "long": "--lastday"
                    },
                    {
                        "name": "-E --expiredate",
                        "lines": 7,
                        "flag": "-E",
                        "long": "--expiredate"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-i --iso8601",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--iso8601"
                    },
                    {
                        "name": "-I --inactive",
                        "lines": 6,
                        "flag": "-I",
                        "long": "--inactive"
                    },
                    {
                        "name": "-l --list",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-m --mindays",
                        "lines": 3,
                        "flag": "-m",
                        "long": "--mindays"
                    },
                    {
                        "name": "-M --maxdays",
                        "lines": 7,
                        "flag": "-M",
                        "long": "--maxdays"
                    },
                    {
                        "name": "-R --root",
                        "lines": 3,
                        "flag": "-R",
                        "long": "--root"
                    },
                    {
                        "name": "-W --warndays",
                        "lines": 9,
                        "flag": "-W",
                        "long": "--warndays"
                    }
                ]
            },
            {
                "name": "NOTE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "EXIT VALUES",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "chage - change user password expiry information\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "chage [options] LOGIN\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The chage command changes the number of days between password changes and the date of the\nlast password change. This information is used by the system to determine when a user must\nchange their password.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The options which apply to the chage command are:\n",
                "subsections": [
                    {
                        "name": "-d --lastday",
                        "content": "Set the number of days since January 1st, 1970 when the password was last changed. The\ndate may also be expressed in the format YYYY-MM-DD (or the format more commonly used in\nyour area).\n",
                        "flag": "-d",
                        "long": "--lastday"
                    },
                    {
                        "name": "-E --expiredate",
                        "content": "Set the date or number of days since January 1, 1970 on which the user's account will no\nlonger be accessible. The date may also be expressed in the format YYYY-MM-DD (or the\nformat more commonly used in your area). A user whose account is locked must contact the\nsystem administrator before being able to use the system again.\n\nPassing the number -1 as the EXPIREDATE will remove an account expiration date.\n",
                        "flag": "-E",
                        "long": "--expiredate"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help message and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-i --iso8601",
                        "content": "When printing dates, use YYYY-MM-DD format.\n",
                        "flag": "-i",
                        "long": "--iso8601"
                    },
                    {
                        "name": "-I --inactive",
                        "content": "Set the number of days of inactivity after a password has expired before the account is\nlocked. The INACTIVE option is the number of days of inactivity. A user whose account is\nlocked must contact the system administrator before being able to use the system again.\n\nPassing the number -1 as the INACTIVE will remove an account's inactivity.\n",
                        "flag": "-I",
                        "long": "--inactive"
                    },
                    {
                        "name": "-l --list",
                        "content": "Show account aging information.\n",
                        "flag": "-l",
                        "long": "--list"
                    },
                    {
                        "name": "-m --mindays",
                        "content": "Set the minimum number of days between password changes to MINDAYS. A value of zero for\nthis field indicates that the user may change their password at any time.\n",
                        "flag": "-m",
                        "long": "--mindays"
                    },
                    {
                        "name": "-M --maxdays",
                        "content": "Set the maximum number of days during which a password is valid. When MAXDAYS plus\nLASTDAY is less than the current day, the user will be required to change their password\nbefore being able to use their account. This occurrence can be planned for in advance by\nuse of the -W option, which provides the user with advance warning.\n\nPassing the number -1 as MAXDAYS will remove checking a password's validity.\n",
                        "flag": "-M",
                        "long": "--maxdays"
                    },
                    {
                        "name": "-R --root",
                        "content": "Apply changes in the CHROOTDIR directory and use the configuration files from the\nCHROOTDIR directory.\n",
                        "flag": "-R",
                        "long": "--root"
                    },
                    {
                        "name": "-W --warndays",
                        "content": "Set the number of days of warning before a password change is required. The WARNDAYS\noption is the number of days prior to the password expiring that a user will be warned\ntheir password is about to expire.\n\nIf none of the options are selected, chage operates in an interactive fashion, prompting the\nuser with the current values for all of the fields. Enter the new value to change the field,\nor leave the line blank to use the current value. The current value is displayed between a\npair of [ ] marks.\n",
                        "flag": "-W",
                        "long": "--warndays"
                    }
                ]
            },
            "NOTE": {
                "content": "The chage program requires a shadow password file to be available.\n\nThe chage command is restricted to the root user, except for the -l option, which may be used\nby an unprivileged user to determine when their password or account is due to expire.\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "The following configuration variables in /etc/login.defs change the behavior of this tool:\n",
                "subsections": []
            },
            "FILES": {
                "content": "/etc/passwd\nUser account information.\n\n/etc/shadow\nSecure user account information.\n",
                "subsections": []
            },
            "EXIT VALUES": {
                "content": "The chage command exits with the following values:\n\n0\nsuccess\n\n1\npermission denied\n\n2\ninvalid command syntax\n\n15\ncan't find the shadow password file\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "passwd(5), shadow(5).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                     CHAGE(1)",
                "subsections": []
            }
        }
    }
}