1

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.

4

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/
1

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/

  • 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. – Rinzwind Mar 17 '16 at 11:09
  • I actually figured the exact same thing and solved the issue before I read these comments. Thank you so much for replying. At least now I know I did the right thing! :D will get back to you guys if I have any more queries.. Thanks again :) – Dheeraj Prakaash Mar 17 '16 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.