{
    "content": [
        {
            "type": "text",
            "text": "# pam_setcred(3) (man)\n\n**Summary:** pamsetcred - establish / delete user credentials\n\n**Synopsis:** #include <security/pamappl.h>\nint pamsetcred(pamhandlet *pamh, int flags);\n\n## See Also\n\n- pamauthenticate(3)\n- pamopensession(3)\n- pamclosesession(3)\n- pamstrerror(3)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (27 lines)\n- **RETURN VALUES** (22 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\npamsetcred - establish / delete user credentials\n\n### SYNOPSIS\n\n#include <security/pamappl.h>\n\nint pamsetcred(pamhandlet *pamh, int flags);\n\n### DESCRIPTION\n\nThe pamsetcred function is used to establish, maintain and delete the credentials of a user.\nIt should be called to set the credentials after a user has been authenticated and before a\nsession is opened for the user (with pamopensession(3)). The credentials should be deleted\nafter the session has been closed (with pamclosesession(3)).\n\nA credential is something that the user possesses. It is some property, such as a Kerberos\nticket, or a supplementary group membership that make up the uniqueness of a given user. On a\nLinux system the user's UID and GID's are credentials too. However, it has been decided that\nthese properties (along with the default supplementary groups of which the user is a member)\nare credentials that should be set directly by the application and not by PAM. Such\ncredentials should be established, by the application, prior to a call to this function. For\nexample, initgroups(2) (or equivalent) should have been performed.\n\nValid flags, any one of which, may be logically OR'd with PAMSILENT, are:\n\nPAMESTABLISHCRED\nInitialize the credentials for the user.\n\nPAMDELETECRED\nDelete the user's credentials.\n\nPAMREINITIALIZECRED\nFully reinitialize the user's credentials.\n\nPAMREFRESHCRED\nExtend the lifetime of the existing credentials.\n\n### RETURN VALUES\n\nPAMBUFERR\nMemory buffer error.\n\nPAMCREDERR\nFailed to set user credentials.\n\nPAMCREDEXPIRED\nUser credentials are expired.\n\nPAMCREDUNAVAIL\nFailed to retrieve user credentials.\n\nPAMSUCCESS\nData was successful stored.\n\nPAMSYSTEMERR\nA NULL pointer was submitted as PAM handle, the function was called by a module or\nanother system error occurred.\n\nPAMUSERUNKNOWN\nUser is not known to an authentication module.\n\n### SEE ALSO\n\npamauthenticate(3), pamopensession(3), pamclosesession(3), pamstrerror(3)\n\n\n\nLinux-PAM Manual                             06/08/2020                               PAMSETCRED(3)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pam_setcred",
        "section": "3",
        "mode": "man",
        "summary": "pamsetcred - establish / delete user credentials",
        "synopsis": "#include <security/pamappl.h>\nint pamsetcred(pamhandlet *pamh, int flags);",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "pamauthenticate",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamauthenticate/3/json"
            },
            {
                "name": "pamopensession",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamopensession/3/json"
            },
            {
                "name": "pamclosesession",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamclosesession/3/json"
            },
            {
                "name": "pamstrerror",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamstrerror/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "RETURN VALUES",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}