Ubuntu Permissions for public_html directory


Recommended Posts

I have a web server running ubuntu and I made the public_html dir different from the standard www directory. I did chown www-data:www-data on the public_html folder (Was that the right thing to do?)

 

Now when I ftp into the server with my user account, I guess I don't have permission anymore. I can't create a new a file for instance via ftp and in the terminal I get access denied.

 

What can I do to give my user the appropriate permissions to still create files and do other standard operations? (I wanted to ask so I don't mess up the permissions :) )

Link to comment
Share on other sites

You don't need to chown to www-data:www-data. The group permissions are redundant, since www-data will have permission as owner.

 

I'd either chown to www-data:<group your user is in> or <your user>:www-data - ensuring that you set the correct permissions too.

Link to comment
Share on other sites

You don't need to chown to www-data:www-data. The group permissions are redundant, since www-data will have permission as owner.

 

I'd either chown to www-data:<group your user is in> or <your user>:www-data - ensuring that you set the correct permissions too.

Okay so I did  "groups adminUser"

Which gave me "adminUser : adminUser"

So then I did "sudo chown -R www-data:adminUser ./public_html"

I still get Permission denied in the terminal.

Is this a permission issue with adminUser group?

Link to comment
Share on other sites

Okay I got it, I had to do the following

Add user to group www-data

chown -R www-data:www-data to the html folder

chmod g+rw to html folder

chmod +s to the html folder

Link to comment
Share on other sites

This topic is now closed to further replies.