Securely setting file permissions for Laravel Framework
- Step 1: chown the root directory: sudo chown -R www-data:www-data /path/to/root.
- Step 2: Grant FTP for uploading and working with files (for using any FTP client): sudo usermod -a -G www-data ubuntu.
- Step 3: Set file permission to 644 : sudo find /path/to/root -type f -exec chmod 644 \;