Menu

User Permissions on Server

November 1, 2015 - ubuntu server

For those who have their wordpress root folder under their home folder:

** Ubuntu/apache

Add your user to www-data group:
CREDIT Granting write permissions to www-data group

You want to call usermod on your user. So that would be:

sudo usermod -aG www-data yourUserName
** Assuming www-data group exists

Check your user is in www-data group:

groups yourUserName

You should get something like:

youUserName : youUserGroupName www-data
** youUserGroupName is usually similar to you user name

Recursively change group ownership of the folder keeping your user ownership

chown yourUserName:www-data -R youWebSiteFolder/*

Change directory to youWebSiteFolder

cd youWebSiteFolder

Recursively change group premissions of the folders and sub-folders to enable write permissions:

find . -type d -exec chmod -R 775 {} \;

** mode of `/home/yourUserName/youWebSiteFolder/’ changed from 0755 (rwxr-xr-x) to 0775 (rwxrwxr-x)

Recursively change group premissions of the files and sub-files to enable write permissions:

find . -type f -exec chmod -R 664 {} \;

The result should look something like:

WAS:
-rw-r--r-- 1 yourUserName www-data 7192 Oct 4 00:03 filename.html
CHANGED TO:
-rw-rw-r-- 1 yourUserName www-data 7192 Oct 4 00:03 filename.html

Equivalent to: chmod -R ug+rw foldername Permissions will be like 664 or 775.

Add www-data permissons:
sudo chown www-data:www-data -R

Leave a Reply