posix — 最常见的 POSIX 系统调用
posix
pwd
This module provides access to the Unix user account and password database. It is available on all Unix versions.
可用性 :Unix,非 Emscripten,非 WASI。
Password database entries are reported as a tuple-like object, whose attributes correspond to the members of the passwd structure (Attribute field below, see <pwd.h> ):
passwd
<pwd.h>
索引
属性
含义
pw_name
pw_passwd
pw_uid
pw_gid
pw_gecos
pw_dir
pw_shell
The uid and gid items are integers, all others are strings. KeyError is raised if the entry asked for cannot be found.
KeyError
注意
In traditional Unix the field pw_passwd usually contains a password encrypted with a DES derived algorithm (see module crypt ). However most modern unices use a so-called shadow password system. On those unices the pw_passwd field only contains an asterisk ( '*' ) or the letter 'x' where the encrypted password is stored in a file /etc/shadow which is not world readable. Whether the pw_passwd field contains anything useful is system-dependent. If available, the spwd module should be used where access to the encrypted password is required.
crypt
'*'
'x'
/etc/shadow
spwd
It defines the following items:
Return the password database entry for the given numeric user ID.
Return the password database entry for the given user name.
Return a list of all available password database entries, in arbitrary order.
另请参阅
grp
An interface to the group database, similar to this.
An interface to the shadow password database, similar to this.
grp — 组数据库
键入搜索术语或模块、类、函数名称。