Add new user with access to web domains

I've never added a second user to any of my servers so I need to ask a question.

I want to add a (trusted) user who is a web-designer… for example.

sudo adduser alice

(She will not need sudo privileges.)

Will she have access to

/var/www/html/webDomain.com/public_html

so that she can add or edit plain old Bootstrap/html files as well as upload images to a folder?

Currently the owner/group and permissions of the public_html directory and files in it are set to

chown $USER:www-data
chmod 775.

Do those need to be changed so she can make changes/additions?

Thanks for the help.

Al

1 Reply

chown $USER:www-data
chmod 775.

  • Directories need execute permission so:
  1. directories that need to be writable by the web server (0775, -rwxrwxr-x) are directories where the web server stores stuff (like cache or upload directories); otherwise
  2. the permissions on a directory should be 0766 (-rwxr-xr-x).
  • No files need execute permission unless you are going to run them as shell commands so all files should be 0644
    (-rw-r--r--). PHP does not execute *.php files. PHP only reads them before interpreting them. This is true no matter if you are using the apache2(8) PHP module (mod_php) or the PHP FastCGI Process Manager (php-fpm(8)).

You should check out git(1) version control if you are going to do this more often or expand your workforce. Here's a couple of references:

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct