terminal: access a folder as root without assigned permission

Discussion in 'Mac OS X Server, Xserve, and Networking' started by darakok, Dec 3, 2010.

  1. macrumors newbie

    Joined:
    Jul 21, 2010
    #1
    Dear mac users,

    My mac is running latest version of snowleopard. From the terminal windows, I want to read a foder content. even though i use the sudo command, i still get empty result.

    the permission setting from the "ls -l" command, only the owner and group member can read it.

    So i want to know if there is a way that root user can read this foder content without becoming member of the group.

    Thanks,

    dara kok
     
  2. LPZ
    macrumors 65816

    Joined:
    Jul 11, 2006
    #2
    Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?
     
  3. thread starter macrumors newbie

    Joined:
    Jul 21, 2010
    #3
    <quote>
    Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?</quote>

    Yes, that's the first solution that came to my mind. But as a root, it suppose to be able to read any folder. that's why I'm asking if there is an alternative way.

    Thanks for your comment.
     
  4. LPZ
    macrumors 65816

    Joined:
    Jul 11, 2006
    #4
    Questions:

    What do you mean by "be able to read the folder"? Do you mean "be able to list the contents of the folder"?

    What happens if you enter

    Code:
    ls -l path-to-folder-here
    ?

    What is the output from

    Code:
    ls -l path-to-folder-here/../
    ?

    Would using sudo -u or sudo -g do what you want?
     
  5. thread starter macrumors newbie

    Joined:
    Jul 21, 2010
    #5
    that's what i'm looking for

    Thank LPZ, sudo -g or sudo -u

    that's what i want to be able to use another user credential to list the folder content.

    Thanks alot. Christmas is coming. Wish u a great holiday.
     

Share This Page