Permission denied is almost always wrong owner, mode or user. Do not jump to chmod 777.
Steps
Inspect owner and permissions:
ls -la /path/to/resourcenamei -l /path/to/resourceFix ownership (web example) or your user:
sudo chown -R www-data:www-data /var/www/projectsudo chown user:user /home/user/fileSet sensible modes (dirs 755, files 644; scripts +x):
sudo find /var/www/project -type d -exec chmod 755 {} \;sudo find /var/www/project -type f -exec chmod 644 {} \;chmod u+x ./script.shFor SSH/SFTP, check
~/.ssh(700) andauthorized_keys(600):chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
Tips
- Run the command as the same user as the service (www-data, git, etc.).
- On mounted disks, check
noexecor NFS root_squash.
ext step
Manage permissions on your own VPS: Deploy your Cloud VPS.