LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-05-2015, 06:16 PM   #1
bruceam
Member
 
Registered: Nov 2008
Location: Atlanta, Georiga
Distribution: Debian, Ubuntu
Posts: 88

Rep: Reputation: 17
"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?

Thank you in advance!


bruceam
 
Old 06-05-2015, 06:20 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
What are the permissions and ownership on the directory itself.

For example, if the directory is /home/bruce/somedirectory...

Code:
cd /home/bruce
ls -ld somedirectory
 
Old 06-05-2015, 06:44 PM   #3
bruceam
Member
 
Registered: Nov 2008
Location: Atlanta, Georiga
Distribution: Debian, Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 17
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 View Post
What are the permissions and ownership on the directory itself.

For example, if the directory is /home/bruce/somedirectory...

Code:
cd /home/bruce
ls -ld somedirectory
 
Old 06-05-2015, 06:52 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
Quote:
Originally Posted by bruceam View Post
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/?
 
Old 06-05-2015, 06:54 PM   #5
bruceam
Member
 
Registered: Nov 2008
Location: Atlanta, Georiga
Distribution: Debian, Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 17
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!

astrogeek - THANKS AGAIN!!!!

bruceam
 
Old 06-05-2015, 06:57 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
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".

Now you know! Glad that helped!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude "Permission denied" files for "ls -al" grob115 Linux - Newbie 3 12-03-2010 09:45 AM
"Permission Denied" when using Ubuntu live cd to recover thunderbird files. gkhoward Linux - Newbie 5 06-04-2009 11:12 AM
"Permission denied" and "recursive directory loop" when searching for string in files mack1e Linux - Newbie 5 06-12-2008 07:38 AM
"Permission denied" when trying to copy files into mounted windows with all rights twist3r Linux - Newbie 14 05-06-2008 05:30 PM
Keep getting "Permission Denied" when trying to write files dunnd40 Debian 2 02-01-2004 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration