Re: UNIX Password change from Windows.
Posted in 1996
Terry asked: > Since Informix for UNIX utilizes the UNIX password verificiation as > user id authentication, we are having difficulty providing an > interface to Windows only (i.e., non-UNIX) Informix users to change > their own "Database" passwords. > We want to avoid presenting a terminal session (i.e., just to run the > "passwd" command). > Questions: > 1. Does anyone have an idea for a New Era or Visual Basic interface > to UNIX passwd? > 2. Any alternatives? > 3. Is there any UNIX API to the "passwd" function? -- I suppose I > could just write directly to the "passwd / shadow" file (as suid > root), but what is the "crypt" key?!!? > Thanks for your consideration. I did something like this for a client. They wanted to add users, change passwords, and delete users from a powerbuilder application so their user admins would not need to see a unix prompt. The basic method I used was from the powerbuilder applications to call a stored procedue which then called a suid program which called the various unix admin utilities to do the work. A couple of tricky issues that you will need to deal with. One is the unix admin utilities will be different on each unix box. A second issue is that some of the utilities check to make sure they are being called by a tty session and do not allow themselves to be called from a script. The unix passwd command was one of these. For these utilities I used another very fine PD tool called "expect" , which sets up a tty session within a script. Get expect, it comes with some examples to changing passwds in a shell script, and is a good place to start. I considered writting directly to the passwd file but using "expect" turned out to be easier. Regards - Lester ############################################################################# # Lester Knutsen lester@access.digex.net # # Advanced DataTools Corporation Voice: 703-256-0267 # # Grant group privileges for Informix databases with DB Privileges # # Visit our Web page: http://www.access.digex.net/~lester # # Washington Area Informix User Group: http://www.access.digex.net/~waiug # #############################################################################