There is no magic procedure, the only way to restore it would be manually.
Fortunatelly the procedure is easy, but it should have to be performed carefully
Step 1: Copy the following script, paste it on your console to generate fixpermission script
echo ‘ chmod -R 755 /bin /boot /dev /etc/ /home /lib /lib64 \ /media /mnt /opt /run /sbin /srv /usr /var
chmod -R 777 /initrd.img /vmlinuz chmod -R 1777 /tmp chmod -R 555 /sys chmod -R 555 /proc chmod -R 700 /root
‘ > fixpermission
chmod +x fixpermission
./fixpermission
The above will create a script named fixpermission and run it by ./fixpermission if not already invoked.
Step 2: Run stat -c ‘%A %a %n’ /* to show your proper directory and their permission as restored.
Example: Your directory permission structure should look similar to the following:
drwxr-xr-x 755 /bin
drwxr-xr-x 755 /boot
drwxr-xr-x 755 /dev
drwxr-xr-x 755 /etc
drwxr-xr-x 755 /home
lrwxrwxrwx 777 /initrd.img
lrwxrwxrwx 777 /initrd.img.old
drwxr-xr-x 755 /lib
drwxr-xr-x 755 /lib64
drwx------ 700 /lost+found
drwxr-xr-x 755 /media
drwxr-xr-x 755 /mnt
drwxr-xr-x 755 /opt
dr-xr-xr-x 555 /proc
drwx------ 700 /root
drwxr-xr-x 755 /run
drwxr-xr-x 755 /sbin
drwxr-xr-x 755 /srv
dr-xr-xr-x 555 /sys
drwxrwxrwt 1777 /tmp
drwxr-xr-x 755 /usr
drwxr-xr-x 755 /var
lrwxrwxrwx 777 /vmlinuz
lrwxrwxrwx 777 /vmlinuz.old