When moving your website to the server and navigating through it in the browser, a nasty error may appear – a page with a 403 code will display instead of your website. This means that the DNS service and web server are functioning, but the page is inaccessible. This is mostly due to incorrect permissions set for files and folders. Linux has all default permissions that ensure full access to files and protect them from changes by other system users. These are permissions 644 for files and 755 for folders. You can learn about the meaning of these bits and the separation of access permissions on Linux using public resources on the web. This answer contains a summary of how to set default permissions for your website’s files and folders.
Connect to the server using SSH. Go to the website’s root folder (it may vary depending on the control panel used). This is the folder where you uploaded website files.
Set permission 644 for files using the following command:
find . -type f -exec chmod 644 {} \;
Permission 755 for folders can be set by analogy:
find . -type d -exec chmod 775 {} \;
Use the below command to change the owner and the group of owners for files and folders:
chown -R new_owner_name:new_group_name
Once you set access permissions, the error is supposed to disappear and your website will appear instead.