Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Say I have a group called mygroup and I want it to have a permission of rwx (777) to the folder /var/www . How do I do this? What is the appropriate command to do this in ubuntu?

share|improve this question

2 Answers 2

chgrp -R mygroup /var/www
chmod -R g+rwxs /var/www

CAUTION: This will overwrite your group ownership and permissions of all files under /var/www.

The 'g' will cause newly-created files or directories to take the same group as the directory they are created in. This is needed to preserve the ownership of newly-created files and directories.

share|improve this answer
sudo chmod 777 /var/www

The sudo part of the command is just providing super user access. This needs to be run from a terminal session.

sudo chmod 777 /var/www -R

will apply to all files and sub folders recursively, underneath /var/www

share|improve this answer
You probably shouldn't do this though. If your web server gets compromized, your /var/www contents can be replaced. Use 775 with the oner and group something else than www-data. –  BillThor Nov 8 '11 at 2:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.