1

Below is my problem , i am using Amazon linux AMI and there is a directory(Tomcat's webapps). when i try to remove that directory that says permission denied. How So?

[root@ip-10-62-71-179 apache-tomcat-7.0.29]# ls -al
    total 260
    drwxr-xr-x 10 root root  4096 Oct 16 10:29 .
    drwxr-xr-x 13 root root  4096 Oct  3 10:46 ..
    drwxr-xr-x  2 root root  4096 Oct 10 08:14 bin
    drwxr-xr-x  3 root root  4096 Oct  8 07:04 conf
    drwxr-xr-x  2 root root  4096 Aug 28  2012 coupon-images
    drwxr-xr-x  2 root root  4096 Aug 28  2012 lib
    -rw-r--r--  1 root root 56812 Aug 28  2012 LICENSE
    drwxr-xr-x  2 root root 61440 Oct 16 10:09 logs
    -rw-r--r--  1 root root  1192 Aug 28  2012 NOTICE
    -rw-r--r--  1 root root  8826 Aug 28  2012 RELEASE-NOTES
    -rw-r--r--  1 root root 15557 Aug 28  2012 RUNNING.txt
    -rw-r--r--  1 root root 63721 Sep 27 14:10 stacktrace.log
    drwxr-xr-x  3 root root  4096 Aug  2 14:14 temp
    drwxrwxrwx  9 root root  4096 Oct 10 07:33 webapps
    drwxr-xr-x  3 root root  4096 Aug 28  2012 work
    [root@ip-10-62-71-179 apache-tomcat-7.0.29]# chmod 777 webapps/
    chmod: changing permissions of `webapps/': Operation not permitted
    [root@ip-10-62-71-179 apache-tomcat-7.0.29]#

Thanks in advance.

7
  • Looks like root isn't the owner of a folder within webapps. I would resolve that problem. Besides webapps already has global read write and execute drwxrwxrwx permisions
    – Ramhound
    Commented Oct 16, 2013 at 10:52
  • i tried as root and non-root (providing only 2 users) they both cant remove anything and cant change permissions Commented Oct 16, 2013 at 10:55
  • What are the permissions and owner of the contents of that folder. Update your question with that information. The only thing I can see is that you have a / which isn't required and Like I said your changing the permissions on a folder that already has global read write execuate permissions why?
    – Ramhound
    Commented Oct 16, 2013 at 11:07
  • @Ramhound hey i am not an expert how to know permissions and owner of directory? and i dont want to change the permission its just whenever i try to delete a file inside that directory -permission denied Commented Oct 16, 2013 at 11:39
  • Can you please post the information I requested. While its strange a non-recursive chmod is giving you that error more information about the contents is required, to determine the cause, of your inability to delete the folder itself.
    – Ramhound
    Commented Oct 16, 2013 at 11:45

1 Answer 1

2

It could be an extended attribute of the filesystem you're using; us lsattr on the file to view the extended attributes, and do man chattr to see what each attribute means. If the file is set as immutable (i), you'll have to remove that attribute before you are able to delete it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .