[fpc-pascal]How to change a users password on Linux

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Fri May 21 23:32:35 CEST 2004


On Fri, 21 May 2004, A.J. Venter wrote:

> Hi,
> 
> I am working on a project that needs among other things to create Linux
> users, and then set a password for them.
> 
> One way to do this is to use a program that can read the password from
> stdin and just wrap around it, for example
> echo "testusers:test" | chpasswd will change testuser's password to test
> on Slackware.
> Likewize redhat likes have a version of passwd that takes a --stdin
> option, so you can do
> echo "test" | passwd --stdin testuser 
> Both these can only be run by root of course.
> 
> The problem is no system seems to support both, and I need maximum
> distribution indepedance. Has anybody else done a frontend for user
> management or similiar system ? Can anyone tell me how  to set a user's
> password in a distribution independant way ?

libc unit. putpwent() and friends.
in the FPC sources, see packages/base/libc/pwdh.inc for all functions.

Michael.




More information about the fpc-pascal mailing list