From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075325906525.tru64-unix-managers.marc@archive.invalid> From: System Administrator Date: Wed, 06 Dec 1995 20:13:08 +0000 To: tru64-unix-managers Subject: SUMMARY: Initial password change X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075325906525 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 and Randy M. Hayman" 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 #include #include #include 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 =-----------------------+--------------------------------------=