non-interactive password

Peter Risdon peter at circlesquared.com
Fri Apr 30 00:14:36 PDT 2004


Bill Moran wrote:

> Louis LeBlanc wrote:
>
>> On 04/24/04 06:52 PM, Mikko Työläjärvi sat at the `puter and typed:
>>
>>> On Sat, 24 Apr 2004, Louis LeBlanc wrote:
>>>
>>>> Hey everyone.  I'm trying to recreate a password script that sets
>>>> passwords (as root on the local system only).  The trick is that it
>>>> must change the password non-interactively.  I had this working, but
>>>> when the system was trashed, the script was lost.
>>>>
>>>> Can someone refresh my memory on the command format?
>>>
>>>
>>>  echo "$password" | pw usermod "$user" -h0
>>>
>>> Might do the trick.
>>
>>
>> 'fraid not.  It fails quietly, but it fails.
>>
>> Thanks anyway.
>
>
> The man page for pw says that pw needs a file descriptor to set the
> password via -h


I have a similar script that modifies passwords like this, where $3 is 
the password and $1 is the username:

echo "$3" | pw usermod $1 -h 0

PWR.


More information about the freebsd-questions mailing list