Module Expr Str ImportFrom alias Import alias Import alias TryExcept body Import alias handlers ExceptHandler type NameLoad body Pass Import alias ImportFrom alias TryExcept body Import alias Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad FunctionDef arguments args defaults body Return CompareEq Call AttributeLoad NameLoad attr Str Str Str decorator_list FunctionDef arguments args defaults body Expr Str Return Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Str Str Str Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Return NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Return CompareEq SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Return NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Return CompareEq SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Return NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Return CompareEq SubscriptLoad NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad keyword Str Assign NameStore Call NameLoad NameLoad Return UnaryOpNot SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad Str attr NameLoad orelse Assign NameStore Str Assign NameStore Dict If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return NameLoad Assign NameStore ListLoad With Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str NameStore body For NameStore NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Str If CompareNotEq SubscriptLoad NameLoad Index Num NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Continue Assign NameStore BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Num Num Num Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad With Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Return CompareEq SubscriptLoad NameLoad Index Str NameLoad orelse Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad keyword Str Assign NameStore Call NameLoad NameLoad Return CompareEq SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Return NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Return CompareEq SubscriptLoad NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad decorator_list
N/A N/A 
Manage the shadow file on Linux systems

.. important::
    If you feel that Salt should be using this module to manage passwords on a
    minion, and it is using a different module (or gives an error similar to
    *'shadow.info' is not available*), see :ref:`here
    <module-provider-override>`.
 __future__ absolute_import N/A os N/A datetime N/A N/A N/A spwd N/A N/A N/A ImportError N/A N/A N/A salt.utils salt.exceptions CommandExecutionError N/A N/A N/A salt.utils.pycrypto N/A HAS_CRYPT True N/A N/A N/A ImportError N/A N/A HAS_CRYPT False __virtual__ N/A N/A N/A N/A N/A N/A N/A N/A __grains__ get kernel Linux N/A default_hash N/A N/A N/A N/A N/A 
    Returns the default hash used for unset passwords

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.default_hash
     N/A ! N/A info N/A N/A name N/A N/A N/A 
    Return information for the specified user

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.info root
     N/A N/A N/A data N/A N/A spwd getspnam name N/A ret N/A name passwd lstchg min max warn inact expire N/A data sp_nam N/A data sp_pwd N/A data sp_lstchg N/A data sp_min N/A data sp_max N/A data sp_warn N/A data sp_inact N/A data sp_expire N/A N/A N/A KeyError N/A N/A N/A name passwd lstchg min max warn inact expire N/A ret N/A set_inactdays N/A N/A name inactdays N/A N/A N/A 
    Set the number of days of inactivity after a password has expired before
    the account is locked. See man chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_inactdays username 7
     N/A pre_info N/A info name N/A N/A inactdays N/A pre_info N/A inact N/A N/A True N/A cmd N/A N/A chage -I {0} {1} format inactdays name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A post_info N/A info name N/A N/A N/A post_info N/A inact N/A pre_info N/A inact N/A N/A N/A N/A post_info N/A inact inactdays N/A set_maxdays N/A N/A name maxdays N/A N/A N/A 
    Set the maximum number of days during which a password is valid.
    See man chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_maxdays username 90
     N/A pre_info N/A info name N/A N/A maxdays N/A pre_info N/A max N/A N/A True N/A cmd N/A N/A chage -M {0} {1} format maxdays name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A post_info N/A info name N/A N/A N/A post_info N/A max N/A pre_info N/A max N/A N/A N/A N/A post_info N/A max maxdays N/A set_mindays N/A N/A name mindays N/A N/A N/A 
    Set the minimum number of days between password changes. See man chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_mindays username 7
     N/A pre_info N/A info name N/A N/A mindays N/A pre_info N/A min N/A N/A True N/A cmd N/A N/A chage -m {0} {1} format mindays name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A post_info N/A info name N/A N/A N/A post_info N/A min N/A pre_info N/A min N/A N/A N/A N/A post_info N/A min mindays N/A False N/A gen_password N/A N/A password crypt_salt algorithm N/A None sha512 N/A N/A 
    .. versionadded:: 2014.7.0

    Generate hashed password

    .. note::

        When called this function is called directly via remote-execution,
        the password argument may be displayed in the system's process list.
        This may be a security risk on certain systems.

    password
        Plaintext password to be hashed.

    crypt_salt
        Crpytographic salt. If not given, a random 8-character salt will be
        generated.

    algorithm
        The following hash algorithms are supported:

        * md5
        * blowfish (not in mainline glibc, only available in distros that add it)
        * sha256
        * sha512 (default)

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.gen_password 'I_am_password'
        salt '*' shadow.gen_password 'I_am_password' crypt_salt='I_am_salt' algorithm=sha256
     N/A N/A HAS_CRYPT N/A N/A N/A CommandExecutionError gen_password is not available on this operating system because the "crypt" python module is not available. N/A N/A N/A N/A N/A salt utils pycrypto gen_hash crypt_salt password algorithm N/A del_password N/A N/A name N/A N/A N/A 
    .. versionadded:: 2014.7.0

    Delete the password from name user

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.del_password username
     N/A cmd N/A N/A passwd -d {0} format name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False output_loglevel quiet N/A uinfo N/A info name N/A N/A N/A uinfo N/A passwd N/A set_password N/A N/A name password use_usermod N/A False N/A N/A 
    Set the password for a named user. The password must be a properly defined
    hash. The password hash can be generated with this command:

    ``python -c "import crypt; print crypt.crypt('password',
    '\$6\$SALTsalt')"``

    ``SALTsalt`` is the 8-character crpytographic salt. Valid characters in the
    salt are ``.``, ``/``, and any alphanumeric character.

    Keep in mind that the $6 represents a sha512 hash, if your OS is using a
    different hashing algorithm this needs to be changed accordingly

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_password root '$1$UYCIxa628.9qXjpQCjM4a..'
     N/A N/A N/A N/A N/A salt utils is_true use_usermod N/A N/A N/A N/A __grains__ N/A os ALT N/A N/A s_file N/A N/A /etc/tcb/{0}/shadow format name N/A N/A s_file /etc/shadow N/A ret N/A N/A N/A N/A N/A N/A os path isfile s_file N/A N/A ret N/A lines N/A N/A N/A N/A N/A salt utils fopen s_file rb fp_ N/A N/A line fp_ N/A N/A comps N/A N/A N/A N/A line strip split : N/A N/A N/A comps N/A 0 name N/A N/A N/A N/A lines append line N/A N/A changed_date N/A N/A N/A N/A datetime datetime today N/A N/A datetime datetime 1970 1 1 N/A N/A comps N/A 1 password N/A N/A comps N/A 2 N/A str N/A changed_date days N/A line N/A N/A : join comps N/A N/A N/A lines append N/A N/A {0}
 format line N/A N/A N/A N/A salt utils fopen s_file w+ fp_ N/A N/A N/A N/A fp_ writelines lines N/A uinfo N/A info name N/A N/A N/A uinfo N/A passwd password N/A N/A cmd N/A N/A usermod -p {0} {1} format name password N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False output_loglevel quiet N/A uinfo N/A info name N/A N/A N/A uinfo N/A passwd password N/A set_warndays N/A N/A name warndays N/A N/A N/A 
    Set the number of days of warning before a password change is required.
    See man chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_warndays username 7
     N/A pre_info N/A info name N/A N/A warndays N/A pre_info N/A warn N/A N/A True N/A cmd N/A N/A chage -W {0} {1} format warndays name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A post_info N/A info name N/A N/A N/A post_info N/A warn N/A pre_info N/A warn N/A N/A N/A N/A post_info N/A warn warndays N/A False N/A set_date N/A N/A name date N/A N/A N/A 
    Sets the value for the date the password was last changed to days since the
    epoch (January 1, 1970). See man chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_date username 0
     N/A cmd N/A N/A chage -d {0} {1} format date name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A set_expire N/A N/A name expire N/A N/A N/A 
    .. versionchanged:: 2014.7.0

    Sets the value for the date the account expires as days since the epoch
    (January 1, 1970). Using a value of -1 will clear expiration. See man
    chage.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_expire username -1
     N/A cmd N/A N/A chage -E {0} {1} format expire name N/A N/A N/A __salt__ N/A cmd.run cmd python_shell False N/A