Results 1 to 3 of 3

Thread: directory permissions not right

  1. #1
    Join Date
    Jan 2010
    Beans
    59

    directory permissions not right

    I am having some strange problems with various sub-directories of my home directory. This is the output
    Code:
    $> ls -l Docs/OpenOfficeTemplates/
    ls: cannot access Docs/OpenOfficeTemplates/PresentationBkgrounds: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/Calc: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/web: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/KeyboardShortcuts: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/Impress: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/KeyboardShortcuts.: Permission denied
    ls: cannot access Docs/OpenOfficeTemplates/Writer: Permission denied
    total 0
    d????????? ? ? ? ?            ? Calc
    d????????? ? ? ? ?            ? Impress
    -????????? ? ? ? ?            ? KeyboardShortcuts
    d????????? ? ? ? ?            ? PresentationBkgrounds
    d????????? ? ? ? ?            ? web
    d????????? ? ? ? ?            ? Writer
    Yet, if I perform the same with sudo, this is the result
    Code:
    $> sudo ls -l Docs/OpenOfficeTemplates/
    total 28
    drw-r--r-- 2 daniel daniel 4096 Dec  7 11:58 Calc
    drw-r--r-- 2 daniel daniel 4096 Dec  7 11:58 Impress
    -rw-r--r-- 1 daniel daniel 2088 Dec  7 11:58 KeyboardShortcuts
    drw-r--r-- 2 daniel daniel 4096 Dec  7 11:58 PresentationBkgrounds
    drw-r--r-- 2 daniel daniel 4096 Dec  7 11:58 web
    drw-r--r-- 3 daniel daniel 4096 Dec  7 11:58 Writer
    Unfortunately, this is prevalent in a number of directories for my production.
    How can I go about fixing this mess?

    If I

    • sudo copy the sub-directories and their contents to a new directory
    • sudo change the owner to myself [danie:daniel]

    I still end up with permission denied and the rows of question marks when I perform ls -l

  2. #2
    Join Date
    Oct 2012
    Beans
    187

    Re: directory permissions not right

    This is because your folders do not have execute permission set
    also post the output of
    Code:
    $> ls -l /Docs
    If you do not get any permission error in that output then the following shall solve your problem
    Code:
    sudo chmod -Rv a+rwX,go-w /Docs/OpenOfficeTemplates

  3. #3
    Join Date
    Jan 2010
    Beans
    59

    Re: directory permissions not right

    thanks for the input... In clearing the execute parameter for a recursive command intended for all files, it was not realised it would hit the directories as well, producing this problem

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •