Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 10-20-2011, 09:00 AM
Junior Member
 
Posts: 8
Default

you're right i see the point of permission. Ok i already change the list.sh and it looks like this
Code:
-rwxr-xr-x 1 root          root                598 2011-10-20 08:13 list.sh
and /tmp/ or /temp/
Code:
drwxr-xr-x   2 root root  4096 2011-10-19 13:57 temp
drwxrwxrwt   5 root root  4096 2011-10-20 08:24 tmp
my list.sh
Code:
TEMPFILE="/tmp/list.txt"
CMDFILE="/tmp/changepw.cmd"
if there's some problem with permissions i change in list.sh the part of:

Code:
chmod 0600 ${TEMPFILE}
chmod 0600 ${CMDFILE}
to
Code:
chmod 0755 ${TEMPFILE}
chmod 0600 ${CMDFILE}
but with same result
Code:
root@mail:/home/administrador# bash list.sh
bash: /tmp/list.txt: Permission denied
so.. i'll try to find out what's wrong..
Reply With Quote
  #12 (permalink)  
Old 10-20-2011, 09:33 AM
Junior Member
 
Posts: 8
Default

ok what i did...?

i finally have the .cmd file with
Code:
modifyAccount user@domain userPassword newPass
what i have in list.sh
Code:
#!/bin/bash
MYDOMAIN="domain"
NEWPASS="newPass"
TEMPFILE="/tmp/list.txt"
CMDFILE="/tmp/changepw.cmd"

# Create the work files and set appropriate permissions.
# touch ${TEMPFILE}
touch ${CMDFILE}
# chmod 0755 ${TEMPFILE}
chmod 0600 ${CMDFILE}

# This will create a list of users in Zimbra for the specified domain.
su - zimbra -c "zmprov -l getAllAccounts ${MYDOMAIN} > ${TEMPFILE}"

# This will loop through the users and create a password reset command file.
while read -a LINE ; do
  echo "modifyAccount ${LINE[0]} userPassword ${NEWPASS}" >> ${CMDFILE}
done < ${TEMPFILE}
rm ${TEMPFILE}
and done ! just need to check all the users and remove the admins, etc. and do
Code:
zmprov < /tmp/changepw.cmd
LHammonds thank you for your help and patience
Reply With Quote
  #13 (permalink)  
Old 10-20-2011, 10:36 AM
Junior Member
 
Posts: 8
Default

ok i use the last command
Quote:
zmprov < /tmp/changepw.cmd
and works !! thnks !!
Reply With Quote
  #14 (permalink)  
Old 10-20-2011, 12:03 PM
Special Member
 
Posts: 138
Default

I'm glad you got it working.

I edited my 1st reply to include clarification on permissions.

Now that I helped you, be sure to help out 2 other people on the forums and pass around the love!

LHammonds
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.