restore correct permissions of web folder accentaly changed

if you run accidentally chmod in a folder you can simply roolback recursely using find :

directory restore 755 :

find /path/of/files -type d -exec chmod 755 {} \;

files restore 644 :

find /path/of/files -type f -exec chmod 644 {} \;

if you made a misteake with chown , that’s more simple :

chown username. -R /path/of/files \;

username : is the username you want to assign permissions.
the fullstop “.” after the username is needed if you wnat to assign the main group, if the username if you would like to to assign to a user and to a specifi groupyou need to use “:”

chown username:group -R /path/of/files \;
Torna in alto