Linux::usermod - modify user accounts
use Linux::usermod;
$user = Linux::usermod->new(username);
#all fields are returned from the class method fields
$user->get(gid); #or the same $user->get(3); $user->get(uid); #the same $user->get(2); $user->get(shell); #the same $user->get(6); $user->get(ppassword); #passwd file $user->get(password); #shadow file - the encoded password
$user->set(password); $user->set(shell);
Linux::usermod->add(username);
#or
Linux::usermod->add(username, password, uid, gid, comment, home, shell);
#where the password goes in shadow file and gid becomes equal to uid unless specified #and uid is becoming the first unreserved number after 1000 unless specified
Linux::usermod->del(username);
print $user->get($_) for (Linux::usermod->fields);
Linux::usermod which adds, removes and modify user account according to the passwd and shadow files syntax (like struct passwd from pwd.h). It is not necessary those accounts to be system as long as Linux::usermod::file_passwd and Linux::usermod::file_shadow are not in "/etc" directory.
Class method - add new user account arguments to add are optional, except username; they may be (username, password, uid, gid, comment, home, shell)
Class method - removes user account
either string or number can be argument
set a field which must be string, but not a number
Lock user account (puts '!' at the beginning of the encoded password)
Unlock user account (removes '!' from the beginning of the encoded password)
/etc/passwd, /etc/shadow unless given your own passwd and shadow files which must be created no matter what their names are as long as Linux::usermod::file_passwd and Linux::usermod::file_shadow vars know about them
getpwent(3), getpwnam(3), usermod(8), passwd(8)
None known. Report any to author.
Vidul Petrov, vidul@abv.bg
© 2004 Vidul Petrov. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
Non-ASCII character seen before =encoding in '©'. Assuming CP1252
To install Linux::usermod, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::usermod
CPAN shell
perl -MCPAN -e shell install Linux::usermod
For more information on module installation, please visit the detailed CPAN module installation guide.