Find the answer to your Linux question:
Results 1 to 9 of 9
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Users cannot enter into a folder, only root


    Hello,

    I have been having a very strange (for me) issue with my Debian server.

    There is a folder (Data), located onto another hard drive, with what seem correct rights to me, which only allows access to root.

    Here come some screenshots:

    First, just doing "ls" from "/"
    Code:
    debian:/home3# ls -l
    total 256
    drwxr-x--- 120 john family   4096 May 31 07:15 Family
    lrwxrwxrwx   1 john Data	   6 Mar 29  2011 Data -> /Data
    drwxr-xr-x  30 john humor 237568 May 30 17:30 Humor
    drwx------   2 root  root	 4096 Dec  5  2009 lost+found
    drwxr-x--- 153 john docs   12288 May 24 18:05 docs
    debian:/home3#
    Then, entering into Data as root:

    Code:
    debian:/home3/Data# ls -l
    total 20
    drwxr-x--- 4 john Data  4096 Nov 11  2010 Data
    drwxr-x--- 2 root  root  16384 Mar  1  2011 lost+found
    debian:/home3/Data#
    Then, Entering again into Data:

    Code:
    debian:/home3/Data/Data# ls -l
    total 8
    drwxr-x--- 9 john Data 4096 Apr 24 20:31 Data
    drwxr-x--- 2 root  root  4096 May 21  2010 lost+found
    debian:/home3/Data/Data#
    And then, if I enter into Data again all my data shows up.

    The problem starts at the first level "/".

    Here comes a screenshot when I try to enter /Data as a normal user:

    Code:
    johnATdebian:/$ cd Data/
    bash: cd: Data/: Permission denied
    johnATdebian:/$
    I know the path is weird, that's something that happened during a restore of the server and I have never understood why that was so, but it used to work anyways and I did not have time to dig into it. However, now no user can enter the /Data folder and it is more worrying.

    Does anyone have any idea why that may be so?

    Thank you in advance
    Last edited by NiceLittleRabbit; 05-31-2012 at 02:32 PM.

  2. #2
    Just Joined!
    Join Date
    May 2011
    Location
    Austin, TX
    Posts
    92
    Quote Originally Posted by NiceLittleRabbit View Post
    Code:
    debian:/home3# ls -l
    lrwxrwxrwx   1 john Data	   6 Mar 29  2011 Data -> /Data
    Then, entering into Data as root:
    Code:
    debian:/home3/Data# ls -l
    drwxr-x--- 4 John Data  4096 Nov 11  2010 Data
    Code:
    debian:/home3/Data/Data# ls -l
    drwxr-x--- 9 john Data 4096 Apr 24 20:31 Data
    Code:
    johnATdebian:/$ cd Data/
    bash: cd: Data/: Permission denied
    johnATdebian:/$
    I know the path is weird, that's something that happened during a restore of the server and I have never understood why that was so, but it used to work anyways and I did not have time to dig into it. However, now no user can enter the /Data folder and it is more worrying.

    Does anyone have any idea why that may be so?

    Thank you in advance
    You have /home3/Data/Data as being owned by John : Data. So is it owned by "john" or "John"? Since "john" isn't "John", "john" can't access it, even if "john" is in group Data, since you don't have the group allowed to r-x.

  3. #3
    Hello Dayid,

    My mistake, the user is john and I made a mistake when copying/pasting the code. I have just checked and all john have small "j", so that does not seem to be the issue.

    Thank you very much for having looked into my issue and I will appreciate if you have any further idea. I have edited the original post to fix this typo which does not reflect reality.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Is the /home3 directory (of which Data/Data seem to be sub-directories) also on another hard drive? Check the home3 folder permissions.
    Also, you try to change directories to Data from what would appear to be your /home/john directory and get a permission denied but you don't have what you show the path: /home3/Data/Data. Do you have a separate Data file in /home/john with incorrect permissions. The first instance of "Data" is just a link to the Data sub-directory. Confusing setup?

  6. #5
    Hello yancek,

    Indeed, the setting is extremely confusing but has been working well for the last years. The initial setting was different, but something happened after a restore.

    The /home3 directory is just a link, pointing to /home/home3 and has 777 and the owner is root:root. The whole /home3 directory is not on a separate hard drive, only the /Data directory.

    There's no Data folder or file in /home/john. In the code I try to get from "/" to /Data, not from my home directory to Data.

    I know the setup is confusing and I tried to fix it ... I assume this is what messed it all up

    Thank you for the time you took and I am eager to hear to other potential explanations and, above all, solutions

  7. #6
    What is the permission of the /Data directory itself?

    Code:
    ls -la /Data

  8. #7
    Code:
    debian:/Data# ls -la
    total 28
    drwxr-x---  4 root  root   4096 Mar  1  2011 .
    drwxr-xr-x 28 root  root   4096 Apr 18 14:18 ..
    drwxr-x---  4 john  Data  4096 Nov 11  2010 Data
    drwxr-x---  2 root  root  16384 Mar  1  2011 lost+found
    debian:/Data#

  9. #8
    Here you go..

    Code:
    debian:/Data# ls -la
    drwxr-x---  4 root  root   4096 Mar  1  2011 .
    ... only root can access /Data directory, therefore if you want to john to have access, change the ownership of /Data folder, e.g.:

    Code:
    chgrp Data /Data
    or
    Code:
    chown john /Data
    or both.

    Other option is to give the permission to read/exec to others:

    Code:
    chmod o+rx /Data
    Balda

  10. #9
    Hello Balda,

    Indeed, after a

    Code:
    debian:/# chown john:Data /Data/
    I could access the directory again. I am now having issues with this folder in Samba, but that is another issue and I will work on it before I ask for help.

    Thank you a lot and to all who read this post and spent some of their time trying to answer it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •