Movatterモバイル変換


[0]ホーム

URL:


Navigation

34.3.spwd — The shadow password database

This module provides access to the Unix shadow password database. It isavailable on various Unix versions.

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

Shadow password database entries are reported as a tuple-like object, whoseattributes correspond to the members of thespwd structure (Attribute fieldbelow, see<shadow.h>):

IndexAttributeMeaning
0sp_namLogin name
1sp_pwdEncrypted password
2sp_lstchgDate of last change
3sp_minMinimal number of days betweenchanges
4sp_maxMaximum number of days betweenchanges
5sp_warnNumber of days before passwordexpires to warn user about it
6sp_inactNumber of days after passwordexpires until account isblocked
7sp_expireNumber of days since 1970-01-01until account is disabled
8sp_flagReserved

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

The following functions are defined:

spwd.getspnam(name)

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

spwd.getspall()

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

See also

Modulegrp
An interface to the group database, similar to this.
Modulepwd
An interface to the normal password database, similar to this.

Previous topic

34.2.pwd — The password database

Next topic

34.4.grp — The group database

This Page

Quick search

Enter search terms or a module, class or function name.

Navigation

©Copyright 1990-2017, Python Software Foundation.
The Python Software Foundation is a non-profit corporation.Please donate.
Last updated on Sep 19, 2017.Found a bug?
Created usingSphinx 1.2.

[8]ページ先頭

©2009-2025 Movatter.jp