0

I user FileZilla for FTP access. I use root to log on through FileZilla, but I want to switch to a sudo user for FileZilla logon. But first I have to give the sudo user write permissions for /var/www/html.

I have read online resources about doing this, but some say to give the sudo user permissions to /var/www first and others say not to do that. The sudo user only needs write access to /var/www/html and folders under /var/www/html.

It appears that I can do this:

sudo usermod -a -G www-html [USERNAME]

but do I need to give that user permission on /var/www as well? Other posts say I should use chmod:

chmod -R g+w /var/www/html

The document at https://support.rackspace.com/how-to/how-to-add-linux-user-with-document-root-permissions says to "change the document root so it and its contents are in the same group as the web server" to "make the document root group-writable." Is that step necessary when I only want to add read-write permission for a sudo user?

I am able to log on through Filezilla with the sudo user's credentials, but I am denied write access.

I haven't done this before, so I'm asking this question to be careful since my web research left some open questions. I don't want to cause permission problems.

Thanks for any help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.