I installed apache2 on Ubuntu just now, and noticed that the /var/www folder is protected. I can just
sudo everything but I would rather just give it write access.
How can I do this?
sudo chmod 7777 /var/www but it didn't work.
To best share with multiple users who should be able to write in
Then set the correct permissions on /var/www.
Additionally, you should make the directory and all directories below it "set GID", so that all new files and directories created under
Find all files in
You might have to log out and log back in to be able to make changes if you're editing permission for your own account.
You can also replicate what jtimberman suggested using access control lists. The setfacl command accepts -s to replace an existing ACL or -m to modify it; -R to make directory ACLs recursive; and -d to make the specified settings the default, which is useful if you're anticipating forthcoming user accounts.
These just set the permissions as you would for the user, group, other, and mask using chmod:
And this could be how you'd do it for a specified user or his/her group:
And of course, the strength is that you can designate any specific user, multiple users, etc., all without having to modify your group settings. And unlike chmod, if you want some groupies to have access to one directory and other groupies to have access only to another, it's actually possible with setfacl. Finally, to view a directory's ACLs, run getfacl:
And you can specify -R to see the ACLs for subdirectories or -d to see the defaults.
Can you just try
A word of warning: if you let everybody access this folder, that means the hackers can access this folder if they gain access to your system. That's why it's better to create a group of permissible users, and give that group write access.
First you enter the particular folder path, then using this command …