spwd —- The shadow password database


    You must have enough privileges to access the shadow password database (this usually means you have to be root).

    Shadow password database entries are reported as a tuple-like object, whose attributes correspond to the members of the spwd structure (Attribute field below, see <shadow.h>):

    The sp_namp and sp_pwdp items are strings, all others are integers. is raised if the entry asked for cannot be found.

    定义了以下函数:

    spwd.getspnam(name)

    Return the shadow password database entry for the given user name.

    在 3.6 版更改: Raises a PermissionError instead of if the user doesn’t have privileges.

    spwd.getspall()

    Return a list of all available shadow password database entries, in arbitrary order.

    参见

    模块

    针对用户组数据库的接口,与本模块类似。

    模块

    An interface to the normal password database, similar to this.