Sponsored Content
Full Discussion: Change password for users
Operating Systems Solaris Change password for users Post 302818863 by cbtshare on Sunday 9th of June 2013 04:00:54 PM
Old 06-09-2013
Passwd: files
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change password by pushing encrypted password to systems

I'm tasked to change a user's password on multiple Linux systems (RH v3). I though copying the encrypted password from one Linux /etc/shadow file to another would work but I was wrong. The long term solution is to establish an openLDAP Directory service, but for now I'm stuck with a manual... (1 Reply)
Discussion started by: benq70
1 Replies

2. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

3. Shell Programming and Scripting

Help- Change the password of users to common one

Hi all I have some 106 users of which i need to change the password of them to a common one. I dont know their paswword. But i need to reset them to a common one. How can i do this with a shell script? It would be a great help if some one can help to sort out this.:b::b: I know it can be... (0 Replies)
Discussion started by: Tuxidow
0 Replies

4. Solaris

How to enforce all users to change their password

Hi All, How to enforce all users to change their password when they try to login. I am having Solaris 9 and 10. Even it would be much better if anyone can say to enforce all users to change their password next morning they login. Thanks in advance, Deepak (3 Replies)
Discussion started by: naw_deepak
3 Replies

5. Shell Programming and Scripting

script to change password for all users

We have a server where we have a number of user ids and we also have the list of old passwords in a CSV file. Now we want to change the password of all the users and assign them a default password.Can we write a shell script to do that. I am planning to read the user name and corresponding... (7 Replies)
Discussion started by: dr46014
7 Replies

6. Solaris

To restrict the users not to change the passwords for NIS users

Hi All, How to restrict the NIS users not to change their passwords in for NIS users?? and my NIS user is unable to login to at client location what could be the problem for this ? Any body can help me. Thanks in advance. (1 Reply)
Discussion started by: Sharath Kumar
1 Replies

7. UNIX for Advanced & Expert Users

Update users password change time

Hello - Is this possible on Unix machines? Can we update user password change time? (6 Replies)
Discussion started by: manju--
6 Replies

8. Shell Programming and Scripting

Bulk NIS Users Password Change

Hi All, I am having Solaris 5.10 acting as NIS. How do i change multiple user password in NIS in a batch. I have predefined users with their passwords to be set: Example: user1 password1 user2 password2 Pls advise. (0 Replies)
Discussion started by: yogajwa
0 Replies

9. AIX

Change password for many users on an AIX server

Hi I want to change password for around 100 users on an aix server. I have the list of those 100 users with me. instead of doing # passwd username for all the 100 users one by one, can you please help with a script through which we can change the password for all the 100 users in a... (2 Replies)
Discussion started by: newtoaixos
2 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies
Passwd::Unix(3pm)					User Contributed Perl Documentation					 Passwd::Unix(3pm)

NAME
Passwd::Unix - access to standard unix files SYNOPSIS
use Passwd::Unix; my $pu = Passwd::Unix->new(); my $err = $pu->user("example", $pu->encpass("my_secret"), $pu->maxuid + 1, 10, "My User", "/home/example", "/bin/bash" ); $pu->passwd("example", $pu->encpass("newsecret")); foreach my $user ($pu->users) { print "Username: $user Full Name: ", $pu->gecos($user), " "; } my $uid = $pu->uid('example'); $pu->del("example"); # or use Passwd::Unix qw(check_sanity reset encpass passwd_file shadow_file group_file backup warnings del del_user uid gid gecos home shell passwd rename maxgid maxuid exists_user exists_group user users users_from_shadow del_group group groups groups_from_gshadow); my $err = user( "example", encpass("my_secret"), $pu->maxuid + 1, 10, "My User", "/home/example", "/bin/bash" ); passwd("example",encpass("newsecret")); foreach my $user (users()) { print "Username: $user Full Name: ", gecos($user), " "; } my $uid = uid('example'); del("example"); ABSTRACT
Passwd::Unix provides an abstract object-oriented and function interface to standard Unix files, such as /etc/passwd, /etc/shadow, /etc/group. Additionaly this module provides environment to testing new software, without using system critical files in /etc/dir. DESCRIPTION
The Passwd::Unix module provides an abstract interface to /etc/passwd, /etc/shadow and /etc/group format files. It is inspired by Unix::PasswdFile module (that one does not handle /etc/shadow file, what is necessary in modern systems like Sun Solaris 10 or Linux). SUBROUTINES
/METHODS new( [ param0 = 1, param1 => 0... ] )> Constructor. Possible parameters are: passwd - path to passwd file; default "/etc/passwd" shadow - path to shadow file; default "/etc/shadow" group - path to group file; default "/etc/group" gshadow - path to gshadow file if any; default "/etc/gshadow" umask - umask for creating files; default 0022 (standard for UNIX and Linux systems) backup - boolean; if set to 1, backup will be made; default 1 warnings - boolean; if set to 1, important warnings will be displayed; default 0 check_sanity() This method check if environment is sane. I.e. if users in shadow and in passwd are the same. This method is invoked in constructor. del( USERNAME0, USERNAME1... ) This method is an alias for "del_user". It's for transition only. del_user( USERNAME0, USERNAME1... ) This method will delete the list of users. It has no effect if the supplied users do not exist. del_group( GROUPNAME0, GROUPNAME1... ) This method will delete the list of groups. It has no effect if the supplied groups do not exist. encpass( PASSWORD ) This method will encrypt plain text into unix style MD5 password. gecos( USERNAME [,GECOS] ) Read or modify a user's GECOS string (typically their full name). Returns the result of operation (1 or "undef") if GECOS was specified. Otherwhise returns the GECOS. gid( USERNAME [,GID] ) Read or modify a user's GID. Returns the result of operation (TRUE or FALSE) if GID was specified otherwhise returns the GID. home( USERNAME [,HOMEDIR] ) Read or modify a user's home directory. Returns the result of operation (1 or "undef") if HOMEDIR was specified otherwhise returns the HOMEDIR. maxuid( ) This method returns the maximum UID in use by all users. maxgid( ) This method returns the maximum GID in use by all groups. unused_uid( [MINUID] [,MAXUID] ) This method returns the first unused UID in a given range. The default MINUID is 0. The default MAXUID is maximal integer value (computed from $Config{ intsize } ). unused_gid( [MINGID] [,MAXGID] ) This method returns the first unused GID in a given range. The default MINGID is 0. The default MAXGID is maximal integer value (computed from $Config{ intsize } ). passwd( USERNAME [,PASSWD] ) Read or modify a user's password. If you have a plaintext password, use the encpass method to encrypt it before passing it to this method. Returns the result of operation (1 or "undef") if PASSWD was specified. Otherwhise returns the PASSWD. rename( OLDNAME, NEWNAME ) This method changes the username for a user. If NEWNAME corresponds to an existing user, that user will be overwritten. It returns FALSE on failure and TRUE on success. shell( USERNAME [,SHELL] ) Read or modify a user's shell. Returns the result of operation (TRUE or FALSE) if SHELL was specified otherwhise returns the SHELL. uid( USERNAME [,UID] ) Read or modify a user's UID. Returns the result of operation (TRUE or FALSE) if UID was specified otherwhise returns the UID. user( USERNAME [,PASSWD, UID, GID, GECOS, HOMEDIR, SHELL] ) This method can add, modify, or return information about a user. Supplied with a single username parameter, it will return a six element list consisting of (PASSWORD, UID, GID, GECOS, HOMEDIR, SHELL), or undef if no such user exists. If you supply all seven parameters, the named user will be created or modified if it already exists. group( GROUPNAME [,GID, ARRAYREF] ) This method can add, modify, or return information about a group. Supplied with a single groupname parameter, it will return a two element list consisting of (GID, ARRAYREF), where ARRAYREF is a ref to array consisting names of users in this GROUP. It will return undef and ref to empty array ("undef, [ ]") if no such group exists. If you supply all three parameters, the named group will be created or modified if it already exists. users() This method returns a list of all existing usernames. users_from_shadow() This method returns a list of all existing usernames in a shadow file. groups() This method returns a list of all existing groups. groups_from_gshadow() This method returns a list of all existing groups in a gshadow file. exists_user(USERNAME) This method checks if specified user exists. It returns TRUE or FALSE. exists_group(GROUPNAME) This method checks if specified group exists. It returns TRUE or FALSE. default_umask([UMASK]) This method, if called with an argument, sets default umask for this module (not Your program!). Otherwise returns the current UMASK. Probably You don't want to change this. passwd_file([PATH]) This method, if called with an argument, sets path to the passwd file. Otherwise returns the current PATH. shadow_file([PATH]) This method, if called with an argument, sets path to the shadow file. Otherwise returns the current PATH. group_file([PATH]) This method, if called with an argument, sets path to the group file. Otherwise returns the current PATH. gshadow_file([PATH]) This method, if called with an argument, sets path to the gshadow file. Otherwise returns the current PATH. reset() This method sets paths to files passwd, shadow, group to the default values. error() This method returns the last error (even if "warnings" is disabled). DEPENDENCIES
Struct::Compare Crypt::PasswdMD5 INCOMPATIBILITIES
None known. BUGS AND LIMITATIONS
None. I hope. THANKS
Thanks to Christian Kuelker for suggestions and reporting some bugs :-). Thanks to Steven Haryanto for suggestions. Thanks to Jonas Genannt for suggestions as well as supplying relevant patch! BIG THANKS to Lopes Victor for reporting some bugs and his exact sugesstions :-) Thanks to Foudil BRA~XTEL for some remarks, suggestions as well as supplying relevant patch! BIG thanks to Artem Russakovskii for reporting a bug. AUTHOR
Strzelecki Lukasz <lukasz@strzeleccy.eu> LICENCE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-11-29 Passwd::Unix(3pm)
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy