Find All Files and Directories that are permissions 777

For directories

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type d -perm 777 -print

Set to 755:

root@server ]# find /var/www/vhosts/domain.com/httpdocs/ -type d -perm 777 -exec chmod 755 {} \;


For Files

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -print

Set to 644:

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -exec chmod 644 {} \;

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.