SUMMARY: Initial password change

From: System Administrator <sysadmin_at_homer.bus.miami.edu>
Date: Wed, 6 Dec 1995 15:13:08 -0500 (EST)

Some time ago I asked about how to force users to change their passwords
when they login to their account for the first time. The machine is
Alphaserver 1000/233 with C2 enabled running DU 3.2c

Thanks to Andrew Brennan <BRENNAN_at_HAL.HAHNEMANN.EDU> and
          Randy M. Hayman" <haymanr_at_icefog.sois.alaska.edu>

Basically one way of forcing users to change their passwords is to set
the successful password change to zero. I include the complete program
that does this:

#include <string.h>
#include <sys/types.h>
#include <sys/security.h>
#include <prot.h>

main(int argc, char *argv[])
{
struct pr_passwd *name;
char *username[9];

if(argc<2){printf("Username not provided..exiting...\n");exit(1);}
set_auth_parameters();
strcpy(username,argv[1]);
if ((name = getprpwnam(username)) == NULL){
                printf("Username not found...exiting...\n");exit(1);}
initprivs(username);
name->ufld.fd_schange=0;
putprpwnam(username,name);
endprpwent();
exit(0);
}

Compile the program with -lsecurity option. This program will accept
user's name as command-line argument so you could put it into the
adduser script somewhere at the end after the password selection...
(eg. /usr/sbin/forcepass ${USER} )


=-----------------------+--------------------------------------=
 Igor Natanzon, | Office Phone : 284-1771
 System Administrator | E-Mail: sysadmin_at_homer.bus.miami.edu
 University of Miami | School of Business Administration
=-----------------------+--------------------------------------=
Received on Wed Dec 06 1995 - 21:44:34 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT