Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 1996 18:21:10 -0600 (MDT)
From:      Dave Andersen <angio@aros.net>
To:        jolp@peerlogic.com (jolp)
Cc:        questions@FreeBSD.com
Subject:   Re: where's crypt(1)
Message-ID:  <199605180021.SAA02033@shell.aros.net>
In-Reply-To: <19c16520@peerlogic.com> from jolp at "May 16, 96 11:01:22 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Lo and behold, jolp once said:
>      
>      Is there any way to set a user's password non-interactively?

>      passwd doesn't seem to work with stdin.  Also, the chpass program requires 
>      modules (DES) that have been left out of the 2.1.0 release.

   We use an expect script to do it.  Simple, easy.  The only 
disadvantage is that you can't run this program on a machine that lets 
users log in, because it shows the password as a command line argument. :-)

#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "word:"
send "$password\r"
expect "word:"
send "$password\r"
expect eof


>      Can anyone tell me wher I can get the other modules?

   You have to install the DES package for FreeBSD.  You can download it 
from ftp.freebsd.org.  Just be careful when you install it (search the 
mailing list archives for more info, there's a ton of material about this 
topic)

>      Thanks,
>      
>      JO
> 


-- 
angio@aros.net                Complete virtual hosting and business-oriented
system administration         Internet services.  (WWW, FTP, email)
http://www.aros.net/          http://www.aros.net/about/virtual
  "There are only two industries that refer to thier customers as 'users'."




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