Score:0

How to create an FTP/SFTP user to manage /var/www which is owned by www-data

ar flag

I am trying to create an FTP user that can manage the /var/www directory which is owned by www-data.

I have seen a post suggesting this:

chown -R newuser:www-data /var/www

How do I create a user and allow that user to manage /var/www without changing ownership of that directory?

in flag
Adding `newuser` to the `www-data` group may be what you're looking for ...
Wade John Beckett avatar
ar flag
@matigo Thank you. When I do that the user is not able to create any files or directories.
ru flag
FYI Apache doesn't need to own the directory, you need to give www-data proper permissions in the subdirs to traverse/recurse. That'll be dependent on your application. I have **NUMEROUS** applications running in `myuser:www-data` setups where I own the files and can edit but so can Apache where it *needs* to. That's a permissions issue that can be resolved easily, Apache doesn't need to own the directory it just needs access to directories and such where it needs ti (based on what your site's application needs are)
Score:1
pe flag

Do not change the owner of the website files, the problem you encountered may occur
Add your editor user to the www-data user group

sudo usermod -a -G www-data newuser

Working with user groups is in line with good practice standards

If you need help with the ftp server setup (directory permissions and restriction), you should specify which ftp server your are running.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.