I am currently trying to modify the content of /var/www/mywebsite
via sftp with my user "exampleadmin" which has root permissions and is in the group "root".
When I try to add a file or directory via SFTP I receive the error message: permission denied
. As of now I am not fully understanding why since my user should have root access.
I listed the folder content of /var/www
with the command ls -la
and got the following results:
drwxr-xr-x 4 root root 4096 May 6 10:00 .
drwxr-xr-x 14 root root 4096 May 6 07:59 ..
drwxr-xr-x 3 root root 4096 May 6 09:49 html
drwxr-xr-x 2 root root 4096 May 6 10:00 mywebpage
Now I have several questions about the permissions that I could not find answers to yet:
If I change the owner or group of the folders/files, will the "root" owner/group be removed, meaning they have no further access?
Is it possible to allow multiple groups and/or users specific permissions such as in Windows or can I only assign a single owner and a single group?
What If I want to have the following setup:
- user 1 with full access
- user 2 with read/execute
- user 3 with deny
- other read-only
If this is the case, there must be a best practice for setting up apache file permissions on a server.