SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Kind of strange problem I just ran into that maybe someone can help me out with. I was just being curious and playing with some commands (still quite learning my linux). I went into the /usr/doc directory and entered - du -sh just to see. To my surprise I got some permission denied's reported:
du: `./krename-3.0.8/doc': Permission denied
du: `./libgphoto2-2.1.6/linux-hotplug': Permission denied
du: `./transcode-1.0.0/html': Permission denied
du: `./transcode-1.0.0/release-notes': Permission denied
264M .
So being curious about this I moved into the krename directory to investigate.
ls -ld doc showed me this:
drw-r--r-- 3 root root 160 2005-09-24 22:10 doc/
lsattr -d doc showed me:
------------- doc
Now am I wrong in assuming that I should be able, as a normal user, to actually read the contents of that directory? It sure isn't letting me.
tim@shadyvale:/usr/doc/krename-3.0.8$ cd doc
-bash: cd: doc: Permission denied
I can read all fine as root of course, but what gives not being able to read it and the others as a normal user?
It looks like the permissions on /usr/doc are wrong for some reason. I just tried what you did on my computer as a normal user, and it works fine. Try this as root:
Not quite. It seems that only the onwner (probably root) of /usr/doc has all permissions, and then the root group has execute and read. Everybody else can only execute, but not read or write. Chances are your user isn't in the root group, so you should set it so that you at least have execute and read permission (don't know about writing though. My computer allows me to write to this folder but I'm not sure if that's really the best way to go.)
The permissions (drwxr-xr-x 741 root root) as far as I understand it, means:
the directory is owned by root, and the group is root also.
the first four letters of the permissions (drwx) mean that it's a directory, and the owner (which is root) has read, write and execution permissions for this directory.
the next three places (r-x) mean that that users belonging to the group of the directory (which is root) has read and execution permissions for this directory.
the last three places (r-x) mean that all other users also have read and execution permissions in this directory...
(could someone comment as to whether I'm understanding and relating this right just to make sure I'm understanding what the permissions mean...so as not to just be looking at things wrong)
So...my user account should have no problem reading it, and doesn't for the most part, except for these directories:
tim@shadyvale:/usr/doc$ du -sh
du: `./krename-3.0.8/doc': Permission denied
du: `./libgphoto2-2.1.6/linux-hotplug': Permission denied
du: `./transcode-1.0.0/html': Permission denied
du: `./transcode-1.0.0/release-notes': Permission denied
Checking out these directories with ls -ld yields:
tim@shadyvale:/usr/doc$ ls -ld /usr/doc/krename-3.0.8/doc
drw-r--r-- 3 root root 160 2005-09-24 22:10 /usr/doc/krename-3.0.8/doc/
with the same permissions on all of the above that du -sh gets a permission denied error on. I've done chmod a+r /usr/doc/kderename-3.0.8/doc as root and still get the same results. I also tried chmod a+r /usr/doc -R as root just to try to make sure everything was set as readable to all users but still get the same results as well...Hence my confusion.
Let me describe how permissions work for directories:
* Read permission (r) allows you to list the directory, i.e. see the names of the files and directories within
* Write permission (w) allows you to create, move and delete files and directories within
* Execute permission (x) allows you to access the directory; which includes the ability to change into that directory and access the files and directories inside, see the attributes of those files, etc.
According to your "ls -l" output, you have a directory that doesn't have execute permission. Without execute permission, a directory is useless, since you have absolutely no access to the stuff inside the directory. On the other hand, if a directory has execute permissions, even if there is no read permission, it is still very useful because you can still access its contents if you know their names.
Ah! Thank you very much for the post spooon and elyk. It's just the missing execute permissions that I wasn't understanding. I was newbie-ishly assuming that read permissions for the directories was what I was looking for, thanks for clearing that up
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.