Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried deleting files on my dekstop (highlight files, press delete) in /usr/share/nginx/www but I'm getting permission denied issues.

What I did was, add www-data and barsoom(current user) to a group:

sudo addgroup web
usermod -a -G web barsoom
usermod -a -G web www-data
chgrp -R web /usr/share/nginx/www

But why can't I still delete the files in /usr/share/nginx/www. I'm still getting Permission denied?

share|improve this question
up vote 1 down vote accepted
  1. You need to logout and log back in after changing group membership in order to obtain the new set of privileges. (Alternatively you can run sg (like su, switch user, but instead switch group) You can see what privileges you current have by running id.

  2. What are the permissions on those files? Even with the group set to web, the group may not have the necessary write permissions.

share|improve this answer

Usually things under /usr/share are owned by root and permissions are -rwxr-x-r-x. The leftmost 3 characters are permissions for the root, followed by the group, followed by everyone (so only root has write access). Did you ls -l to see the permissions? Changing the group owner won't change the permissions. You need chmod for that.

If you really want to delete those files, open a terminal and:

cd /usr/share/nginx
sudo rm -r www

The -r is for recursive so that everything in that directory including itself will be removed.

share|improve this answer

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.