Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 1999 10:56:59 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        cesar@mail.uigv.edu.pe
Cc:        Steve Hovey <shovey@buffnet.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: pwd.db 
Message-ID:  <93142.938509019@axl.noc.iafrica.com>
In-Reply-To: Your message of "Mon, 27 Sep 1999 21:30:13 %2B0500." <199909271630.VAA02795@mail.uigv.edu.pe> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 27 Sep 1999 21:30:13 +0500, Cesar KMo Prueba wrote:

> In Perl there are the function crypt($word, $salt), 
> that encrypt the one \"word\" using a \"salt\" to create 
> encrypt password, that in Solaris 2.X is generally put  
> on the file /etc/shadow. How I can do the same in 
> FreeBSD?

FreeBSD is supplied with perl. Here's an example program that you can
use to generate encrypted passwords using perl's crypt() function.

#!/usr/bin/perl
#
$| = 1;
print "Salt:     ";
$salt = <STDIN>;
chomp $salt;
print "Password: ";
$passwd = <STDIN>;
chomp $passwd;

print "Crypted password: ", crypt($passwd, $salt), "\n";
#end of script

One way to get the crypted passwords you generate into your
master.passwd file (and, of course spwd.db) is to use vipw(8).

Ciao,
Sheldon.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?93142.938509019>