How I can run the command the command on the Putty for change the permisions?
I want to set permission for files should be 644 and permissions for folders should be 755 in the publick_html.
Please help me.
How I can run the command the command on the Putty for change the permisions?
I want to set permission for files should be 644 and permissions for folders should be 755 in the publick_html.
Please help me.
Assuming the full directory path is /var/www/public_html (probably not publick_html), this finds all directories (except hidden ones) under it and sets the permissions 755 for them:
find /var/www/public_html/* -type d -exec chmod 775 '{}' \;
To change permissions for all regular files (except hidden ones):
find /var/www/public_html/* -type f -exec chmod 644 '{}' \;
If you are not sure, what find might find, try putting echo before chmod, so the chmod commands only get shown, not actually run, e.g.:
find /var/www/public_html/* -type f -exec echo chmod 644 '{}' \;
If running a command gives you the error "Permission denied", prefix it with sudo, however being extra careful, e.g.:
sudo find /var/www/public_html/* -type d -exec chmod 775 '{}' \;