[SOLVED] "Permission Denied" Issues with files that I created
DebianThis forum is for the discussion of Debian 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.
"Permission Denied" Issues with files that I created
I have a subdirectory, specifically containing the contents of a system backup I made quite a while ago. After I installed Jessie, I went to this subdirectory to restore the applications whose data I had backed up there. It was not a problem.
This afternoon, I went back to that subdirectory to check on a setting, and I was denied permission to enter it. I could get in as root, but I should have been able to get in under my account name, just as I had done before.
I went into a root shell, and issued a "chown -Rc <username>:<group>" command to change everything there to my ownership. The results of this command were that no changes were made. All the files and directories were already listed as belonging to <username>:<group>.
When I went back out to my normal console command line, I was still told that I could not enter that subdirectory because "permission denied".
Does anyone have any idea what is going on here, and how to rectify the situation?
astrogeek,
The permissions of the directory are as they should be <myusername>:<mygroup>, just like the other directories that I can get into without having to invoke a root shell.
Thank you for your rapid reply!
bruceam
Quote:
Originally Posted by astrogeek
What are the permissions and ownership on the directory itself.
For example, if the directory is /home/bruce/somedirectory...
astrogeek,
The permissions of the directory are as they should be <myusername>:<mygroup>, just like the other directories that I can get into without having to invoke a root shell.
Thank you for your rapid reply!
bruceam
Well, that is the ownerships, but we still don't know the permissions. What is the output of ls -ld somedirectory/?
astrogeek,
Your post was more helpful than I first realized. I was looking at the print out of the "ls -ld" command when I noticed that all the other directories in this location (THAT I COULD GET INTO) had their "Execute" flag set. In other words, the permissions/mode for the directory I was having problems with were
'drw-r--r-- n <myusername> <mygroup> etc...'
while the other directories, which I could access, had the following permissions:
'drwxr--r-- n <myusername> <mygroup> etc...'
I didn't realize that a subdirectory had to be "executable". When I changed the permissions of the problem subdirectory, everything began to work just as it should!
Yes, the "execute" bit must be set for you to be able to enter a directory.
To be more precise, you cannot execute a directory, so the bit has a different meaning in directory context - "traversal" or "cross". It means that a user can traverse, or cross the directory boundary. But it is still "x" and everyone still calls it "execute".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.