Permission denial for my own folder (myName) inside home folder

22,770

Solution 1

You need sudoevery time because you cannot read the folder with your dheeraj user.

First regain ownership of your home, but only the directory (not -R), then show us the result of the ls -la to see how far the issue went.

chown dheeraj:dheeraj /home/dheeraj/
chmod 750 /home/dheeraj/

Solution 2

Looks like you may experience loose of ownership on home folder.

Take ownership of dheeraj and sub objects:

chown -R dheeraj:dheeraj /home/dheeraj/

And to be sure, change access permissions for it:

chmod -R 750 /home/dheeraj/

Share:
22,770

Related videos on Youtube

Dheeraj Prakaash
Author by

Dheeraj Prakaash

Updated on September 18, 2022

Comments

  • Dheeraj Prakaash
    Dheeraj Prakaash over 1 year

    When we enter any existing directory using the terminal in Ubuntu, the first few unique characters of the name of the directory is enough to type and then to hit the Tab. This successfully happens for my /home/ directory but not for the directory inside it.

    The directory inside /home/ is in my name i.e /home/dheeraj/ and this is the only directory present in /home/.

    So when I enter /home/ and hit Tab, I am supposed to automatically enter /home/dheeraj/ ,which happened until this morning!

    Just to test this, when I do ls in /home/ it says:

    **ls: cannot open directory .: Permission denied**   
    

    WHHYYY???? :(

    At the same time, when I do sudo ls it asks me for the password and then shows me the dheeraj directory. So at-least I can access this directory for now, but why do sudo every time? I need some help figuring this out.

    I can't access my home folder when I hover my mouse to the file manager and click on home folder. It says I don't have the permission to access. The same problem even with the root folder. In fact, there's a grey coloured cross displayed on these folders. I'm not sure about the root folder but the home folder is SUPPOSED TO BE ACCESSIBLE by me.

    Also, using chmod and changing the privileges did not help!

    HINT: I think I used chown earlier today in order to do something else, and I think that created this issue. I have to reverse this whole thing somehow, else it's going to be really inconvenient. I looked up a lot of forums and tried to find answers. It definitely helped me get a vague idea about this, but I'm not able to resolve it. I NEED SOME HELP.

  • Rinzwind
    Rinzwind about 8 years
    Careful with this. NOT all files in /home/$USER/ are suppose to be owned by the user .dbus and .gvcf are set to "root:root". ".xsession-errors" and ".Xauthority" should be "rw" only for user.