root user cannot remove, move, rename web folder of any added website?!

Discussion in 'General' started by PVasileff, Sep 16, 2013.

Thread Status:
Not open for further replies.
  1. PVasileff

    PVasileff Member

    Can you tell me why a root user cannot remove, move, rename web folder of any added website?

    Code:
    [email protected]: /var/www/domain.com $ mv web web_old
    mv: cannot move `web' to `web_old': Permission denied
    I try to use full path (not symlink of domain.com)

    Code:
    [email protected]: /var/www/clients/client1/web1 $ mv web web_old
    mv: cannot move `web' to `web_old': Permission denied
    the result is same..

    Interesting to me how come the root account has no rights to make these changes? These folders as system folder are marked or what?

    Can I fix that..
     
    Last edited: Sep 16, 2013
  2. rosehosting

    rosehosting Member

    can you post the permissions of the directories/files in question? also, what is the output of the 'id' or 'whoami' commands?

    did you verify that the directories/files do not have immutable flag? can you run those commands under 'strace' so we can know what sys calls are called?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The web directories are protected. run:

    chattr -i /var/www/clients/client1/web1

    to remove the protection and when you are finished, protect it again with:

    chattr +i /var/www/clients/client1/web1
     
  4. PVasileff

    PVasileff Member

    Thanks, Till.
     
  5. Etcetera

    Etcetera Member HowtoForge Supporter

    Just tried this after a web search brought me here, but it didn't work out; permission was denied even after chattr -i. Were there any changes since 2013 when this thread was started?
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What command are you using with which arguments?
    I can not see how the commands @till showed in #2 would not work. Provided the commands are issued as root user, the file system is not mounted read-only and the other usual suspects.
     
  7. Etcetera

    Etcetera Member HowtoForge Supporter

    I tried 'mv' to either rename the 'web' directory in place or move it into the 'private' directory. I tried issuing the commands as root and as the web user owning the directories. (It turned out, though, that I didn't have to move or remove 'web'; for what I wanted to achieve, I just needed to mount another resource in it.)
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    This can't work as the website root folder is protected with the immutable bit. But the solution has been posted in this thread already, see post #3. You must unlock the folder using chattr command first:

    chattr -i /var/www/clients/client1/web1
     
Thread Status:
Not open for further replies.

Share This Page