[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Ldap and samba passwords? (found it!)

Here's the text of a previous message from when I first started using the
script....it's below...


I used the script just as it was written on the list.  Here it is below....
In your case, you could read all of the variables in from a text file,
comma delimited...
For example:
A file containing use information called usserinfo:



Cat userinfo|while read line; do
first=$(echo $line|cut -f1 -d ',')
last=$(echo $line|cut -f2 -d ',')
gid=$(echo $line|cut -f3 -d ',')
password=$(echo $line|cut -f4 -d ',')
uname=$(echo $line|cut -f5 -d ',')
smbldap-useradd.pl -a -m -g $gid -c "$first $last" $uname
echo -e $password\\n$password|smbldap-passwd.pl $uname
chown -Rf $uname.$gid /home/$uname
chmod -Rf og+rX-w,u+rwX /home/$uname

I saved the above script with a name like   useraddscript.sh     and ran
it using      

. useraddscript.sh

(make sure the userinfo file you create with the user information and
passwords is in the same directory)  One word of caution....there will be
an error message that pops up with each time it works on a user....doesn't
mean anything...it still works....you'll see a message that says "all
authentication tokens updated"   this means it's working fine.  Ignore the
little error.  If you get more than that...then worry.  NOTE:  as a group
we need to find a way to make the message go away..... 

David N. Trask
Technology Teacher/Coordinator
Vassalboro Community School
dtrask vcs u52 k12 me us

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]