Setting Permissions via SSH

Setting multiple file permissions can be a chore, especially if you’re doing so via FTP or a web interfance like the cPanel File Manager. However, if you’ve got shell access it certainly doesn’t need to be.

If you need to set permissions for a large number of files & folders simply cd to the right parent directly and type:

chmod -R 755 *

The -R flag will recursively set permissions for all files & sub-directories, just replace 755 with your desired permission.

Sometimes it is also desirable to set specific permissions for directories only, normally 755. You can do this with the following command:

find . -type d -exec chmod 755 {} ;

This will find all directories and exec the chmod command to change their permissions recursively beneath the parent.

Leave a Reply