• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Password Changing Script

KrazyBob

Regular Pleskian
Years ago I got the attached script from Plesk support but never tried it. I see that it needs to be slightly modified but basically it sets a date on which the passwords will be changed and notifies the clients. I have some Plesk 9-12 servers to upgrade to Onyx but want to change the passwords first. Has anyone tried this script? Modified it?


Plesk - Ensim Encryped Password Email Scripts

# to prepare a list of mail names with new passwords:

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e"select concat(m.mail_name, '@', d.name) from domains d, mail m, accounts a where m.dom_id=d.id and m.account_id=a.id and a.type='crypt'" | while read mailname ; do newpass=`tr -dc A-Za-z0-9_%#- < /dev/urandom | head -c 12` ; echo $mailname $newpass ; done > list.txt

# to notify users (please, change the text in quotes):

cat list.txt | while read mailname password ; do echo "Starting 2011-05-10 your mailname account's password will be changed to $password" | mail -s "Password change notification" $mailname ; done

# to change passwords on day X:

cat list.txt | while read mailname password ; do /usr/local/psa/bin/mail -u $mailname -passwd_type plain -passwd "$password" ; done

=====

After further testing on our test environment I have made some corrections to the scripts for web users. Please, use this last version:

# To prepare lists of users with new passwords:

ftpusers: mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e"select s.login, d.name from domains d, hosting h, sys_users s, accounts a where a.type='crypt' and a.id=s.account_id and s.id=h.sys_user_id and h.dom_id=d.id" | while read login; do newpass=`tr -dc A-Za-z0-9_%#- < /dev/urandom | head -c 12` ; echo $login $newpass ; done > ftpusers.txt

ftpsubusers: mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e"select concat(sd.name, '.', d.name), s.login from domains d, subdomains sd, sys_users s, accounts a where a.type='crypt' and sd.dom_id=d.id and sd.sys_user_type='native' and sd.sys_user_id=s.id and s.account_id=a.id;" | while read login; do newpass=`tr -dc A-Za-z0-9_%#- < /dev/urandom | head -c 12` ; echo $login $newpass ; done > subftpusers.txt

webusers: mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e"select s.login, d.name from domains d, web_users wu, sys_users s, accounts a where a.type='crypt' and a.id=s.account_id and s.id=wu.sys_user_id and wu.dom_id=d.id" | while read login; do newpass=`tr -dc A-Za-z0-9_%#- < /dev/urandom | head -c 12` ; echo $login $newpass ; done > webusers.txt


# To change passwords:

cat ftpusers.txt | while read login name password; do /usr/local/psa/bin/domain -u $name -login $login -passwd_type plain -passwd "$password" ; done

cat subftpusers.txt | while read login name password ; do /usr/local/psa/bin/subdomain -u $name -login $login -passwd_type plain -passwd "$password" ; done

cat webusers.txt | while read login name password ; do /usr/local/psa/bin/webuser -u $login -passwd_type plain -passwd "$password" -domain $name ; done
 
Back
Top