Permission errors are among the most common Linux issues. Here's how to diagnose and fix them.
Check File Permissions
ls -la /path/to/fileCommon Fixes
# Web files should be owned by www-data
chown -R www-data:www-data /var/www/html
# Directories: 755, Files: 644
find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;SSH Key Permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_ed25519Script Execution
chmod +x script.sh