1

I guess I need some help from an advanced Unix user...

On a Ubuntu System I did something stupid. I typed sudo chmod 774 .* or the like, in a subfolder of my home folder and then I suddenly could not change the directory to my home directory anymore. I'm not quite sure about the exact numbers in the command, but I am sure about the .*.

Now, after a reboot, I can't even log into the GUI anymore and when I Ctrl + Alt + F1 into a console and log in, I get the message No directory, logging in with HOME=/.

When I then try to cd into /home/myusername, I get the error: -bash: cd: /home/myusername: Permission denied. Also, ls can't access the folder.

I checked the permissions of /home/myusername using sudo, and they are all correctly set to:

drwxr-xr-x 25 myusername myusername 4096 Aug 26 17:30 myusername

A testuser, that I created, has the same promblems. It cannot log into the GUI, either. Only a guest session can do it (I guess that is because the guest home folder is created inside /tmp).

What do I need to do, to restore my permissions/get access to my home folder again??? Any suggestions?

Cheers, Sebastian

  • What are the permissions on /home? Maybe there is a x permission missing for a directory? ls -ld /home – Volker Siegel Aug 27 '14 at 11:58
  • @VolkerSiegel There was indeed an x permission missing for world in /home. Seems like this solved the problem! I will report, once I have confirmed that all is functioning. – Sebastian S. Aug 27 '14 at 12:42
1

So, you own your home direcory /home/myusername, and have rwx permissions on it.

But a
cd /home/myusername
gives a Permission denied?

That looks like you are not allowed to look at /home in the to begin with, before it comes to actually looking up myusername in that directory.

With
sudo chmod 774 .*
in /home/myusername, you included the file ...
And /home/myusername/.. is the same as /home.

The permissions were applied as root, so the 4 is what applies to you a a normal user. this is r--, it does not contain the execute permission. On a directory, the execute permission is what allows you to look inside the directory.

The problem applies to all users that have their home directory under /home, as you already found out.

  • Right! Since the rights of home were accidentally set to drwxrwxr-- root root 4096 Aug 26 17:30 home, none of the ordinary users could access it. With a sudo chmod u+X /home the problem could be fixed. Thanks a lot! – Sebastian S. Aug 27 '14 at 12:56

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.