PDA

View Full Version : terminal: access a folder as root without assigned permission




darakok
Dec 3, 2010, 02:09 AM
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



LPZ
Dec 3, 2010, 02:18 AM
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

Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?

darakok
Dec 3, 2010, 02:27 AM
<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.

LPZ
Dec 3, 2010, 04:12 AM
<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.

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

ls -l path-to-folder-here?

What is the output from

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

Would using sudo -u or sudo -g do what you want?

darakok
Dec 3, 2010, 06:20 AM
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.