dan_paul
dan_paul

Reputation: 309

How to set permissions on Ubuntu server to allow Apache user and second user to write to web directory?

I'm trying to setup a basic Ubuntu 14.04 web server but am having trouble setting file ownership correctly. I want the Apache user (www-data) to have ownership of the web directory (/var/www) and my user to have membership in the apache group. I want both my user and Apache to have the ability to read and write to the /var/www directory.

This is the permission and ownership for the directory I want to share:

drwxrwxr-x 3 www-data www-data 4096 Aug 23 13:39

I've added myself to the www-data group and recursively set permissions on the web directory to 775. Apache is able to read and write but my user, when attempting to add a file over SFTP is getting "permission denied" messages.

What am I doing wrong and should I have ownership setup differently?

Upvotes: 0

Views: 1290

Answers (1)

fleger
fleger

Reputation: 46

Hi, two things to check:

is your user a member of /etc/group:www-data

in /etc/sshd_config, is the user have authorization by pam or AllowGroups+AllowUsers ?

Upvotes: 1

Related Questions