Docs / Troubleshooting / How to Fix "Permission Denied" Errors

How to Fix "Permission Denied" Errors

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 123 views · 1 min read

Permission errors are among the most common Linux issues. Here's how to diagnose and fix them.

Check File Permissions

ls -la /path/to/file

Common 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_ed25519

Script Execution

chmod +x script.sh

Was this article helpful?