* SUMMARY: Initial password change
@ 1995-12-06 20:13 System Administrator
0 siblings, 0 replies; only message in thread
From: System Administrator @ 1995-12-06 20:13 UTC (permalink / raw)
To: tru64-unix-managers
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@HAL.HAHNEMANN.EDU> and
Randy M. Hayman" <haymanr@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@homer.bus.miami.edu
University of Miami | School of Business Administration
=-----------------------+--------------------------------------=
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-12-06 20:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-12-06 20:13 SUMMARY: Initial password change System Administrator
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox