[CentOS] Generating password string in /var/nis/passwd with Perl

Stephen Harris lists at spuddy.org
Tue Jan 20 16:14:52 UTC 2009

On Tue, Jan 20, 2009 at 05:11:27PM +0100, Alexander Farber wrote:

> I could skip one manual step (calling yppasswd) if I knew
> how to generate the passwd string for /var/nis/passwd:
> farber:oav3dV4.Mnj/.:10154153:5725:Alexander

> Has anybody already figured out, how to do it from Perl?

crypt is the function to call.

  print crypt("hello","ab")

The "ab" is the salt and should be chose from [a-zA-Z0-9./]

"man 3 crypt" for the C version, which the perl version mimics



More information about the CentOS mailing list