CfgTie::TieShadow -- an associative array of user names to password information
This module makes the shadow database available as a regular hash.
This is a straightforward hash tie that allows us to access the shadow password database sanely.
This tie is available for programmers:
tie %shadow,'CfgTie::TieShadow'
$shadow{$name} will return a hash reference of the named shadow information
$shadow{$name}
Any given shadow entry has the following information associated with it (the keys are case-insensitive):
Name
Login name
Password
The encrypted password
Last
Last time it was changed
Min
The minimum number of days before a change is allowed
Max
Maximum number of days before a change in passwords is required
Warn
The number of days before expiration that they will receive a warning
Inactive
The number of days before an account is inactive
Expires
The date the account expires on
The number of days after a password expires that the account is considered inactive and expires
Each of these entries can be modified (even deleted), and they will be reflected in the overall system. Additionally, the programmer can set any other associated key, but this information will only available to the running Perl script.
&CfgTie::TieShadow'status()
&CfgTie::TieShadow_id'status()
Will return stat information on the shadow database.
stat
$CfgTie::Tiehadow_rec'usermod contains the path to the program usermod. This can be modified as required.
$CfgTie::Tiehadow_rec'usermod
$CfgTie::TieShadow_rec'useradd contains the path to the program useradd. This can be modified as required.
$CfgTie::TieShadow_rec'useradd
$CfgTie::TieShadow_rec'userdel contains the path to the program userdel. This can be modified as required.
$CfgTie::TieShadow_rec'userdel
/etc/passwd /etc/group /etc/shadow
CfgTie::Cfgfile, CfgTie::TieAliases, CfgTie::TieGeneric, CfgTie::TieGroup, CfgTie::TieHost, CfgTie::TieNamed, CfgTie::TieNet, CfgTie::TiePh, CfgTie::TieProto, CfgTie::TieServ, CfgTie::TieShadow, CfgTie::TieUser
group(5), passwd(5), shadow(5), usermod(8), useradd(8), userdel(8)
The current version does cache some shadow information.
Randall Maas (randym@acm.org)
To install Secure::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Secure::File
CPAN shell
perl -MCPAN -e shell install Secure::File
For more information on module installation, please visit the detailed CPAN module installation guide.