On Mon, 17 Aug 1998, Shawn Craver wrote:

> I'm trying to set up a script to add a large number of users to my
> system (Slackware 3.4) and am having trouble getting usermod to encrypt
> the password in the shadow file. Any ideas as to ow to create a script
> that would cause the password to be encrypted would be appreciated. 
> 
>       Thanks,
>       Shawn Craver
> 

I never did it directly from a script. However, I once wrote a short C
program to encrypt passwords. I don't have it here right now, but the
significant system call is crypt (try man crypt). This call gets a
password and a two character "salt" (which should be chosen randomly, but
if all you need is preset first-use passwords, you can just choose "aa" or
something), and returns an encrypted password. I once inserted such a
password in the shadow file, and was able to log in, so it definitely
should work.

Frank

Reply via email to