W
W
wagwan2016-04-21 18:28:58
linux
wagwan, 2016-04-21 18:28:58

How to set permissions on the /var/www folder?

Hello.
It is necessary to enable a normal user to edit folders and files in the /var/www directory. I
'm used to transferring any files directly to a folder on Windows, but it's still inconvenient with the terminal.
Advise how to give the rights. Second day on Ubuntu.
Linux Ubuntu 14.04.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Myvrenik, 2016-04-21
@wagwan

First, create a group:
Then add yourself to this group:
Then give the created group permission to write to the directory:

sudo chown -R root:groupname /var/www
sudo chmod 775 /var/www

replace username and groupname with your own. You may need to re-login.

A
Andrey Mikhalev, 2016-04-22
@Endru9

Giving execute permissions to files is potentially dangerous.
All directories should have permissions 775 and files 664, so:

find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;

otherwise hello from shell

D
dimonkoz, 2016-04-21
@dimonkoz

https://ru.wikipedia.org/wiki/Chmod
You can read there what permissions you need
sudo chmod -R 777 /var/www will allow everyone to read, edit and run
664 for the group

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question