change permissions with a script

16 Aug

#!/usr/local/bin/bash

USERNAME=your own username
DOMAIN=your own domainname

#!/usr/local/bin/bash

USERNAME=your own username
DOMAIN=your own domainname

find /hsphere/local/home/$USERNAME/$DOMAIN/ -type f -perm 777 -exec chmod 600 {} \;; > /dev/null 2>&1

find /hsphere/local/home/$USERNAME/$DOMAIN/ -type d -perm 777 -exec chmod 755 {} \;; > /dev/null 2>&1
————————————————————

That’d find any files with exact 777 perms and change them to 600
and it’d find any dirs with exact 777 perms and change them to 755

Again, you can get very creative once you get SHELL account on the
server and do a

man find

The above is given only as example