[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

programmatically setting a password



I have a Java program I am trying to run on Linux which will create users and
set their passwords automatically.  I can shell out to the "useradd" program via
an EXEC call, but the "passwd" program does not accept the password as a command
parameter -- even when running as root (as my Java program is).

I am wondering if someone can either direct me to a small program (written in
Perl, C/C++, or hopefully Java) which can set the password via function call.
If this could be done in Java via a JNI wrapper around the PAM C library
function, that would be great!  This could probably prove very useful to those
who might wish to make a Java graphical application for Linux to help with
system administration.  LINUXCONF is great but the more the API is opened, the
better so people can continue to be creative.

If anyone can help me, or point me in the right direction, that'd be great!  I'd
prefer the Java native interface method foremost, but am proficient with C/C++
and know enough Perl to understand it.

Thanks,

Justin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []