> Does anyone know if there is a way to automate the addition of user onto
> a Solaris 8 machine? I would like to use perl and useradd, but that
> won't work for the password, which needs to be run interactivly with the
> passwd command. Anyone gone through this and can provide some pointers?
You can use Expect (Tcl-based scripting language), but under Solaris [78]
/usr/lib/makekey may be useful as well. Once I wrote about addition of
encrypted passwords to /etc/shadow from shell script:
% In bourne shell you can use smth like the following to generate new 'shadow' file:
%
% e_pass=`printf "%-8s${salt}\n" "$password" | tr ' ' '\000' | /usr/lib/makekey`
% echo "${username}:${e_pass}:${day}::::::" >> shadow.new
%
% where variables named 'username', 'password', 'salt', and 'day' contain
% username, clear text password, 2-character salt, and day of unix epoch
% respectively (there are no man page for the 'makekey' program :-().
Just checked: this works under Solaris 8, but there are no man pages for
makekey (still :-().
--
andrei