tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: System Administrator <sysadmin () homer ! bus ! miami ! edu>
To: tru64-unix-managers
Subject: SUMMARY: Initial password change
Date: Wed, 06 Dec 1995 20:13:08 +0000	[thread overview]
Message-ID: <96075325906525.tru64-unix-managers.marc@archive.invalid> (raw)



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
=-----------------------+--------------------------------------=       

                 reply	other threads:[~1995-12-06 20:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox