Can't access home folder

10,646

You just need to chown the directory back to yourself.

sudo chown -R user /home/user
Share:
10,646

Related videos on Youtube

user274219
Author by

user274219

Updated on September 18, 2022

Comments

  • user274219
    user274219 almost 2 years

    While installing Matlab, I mistakenly typed sudo chmod +x ./java in the home folder.

    And I got i/o error that you are not allowed to access the home folder. Suddenly everything in my home folder disappeared.

    Although the disk shows filled up data. I guess the folder permission need to be changed.

    • sohel4r
      sohel4r about 10 years
      first see your home folder permission ls -l.if there have't any execute permission then give permission with 744 or u+x;
    • user274219
      user274219 about 10 years
      ls -l does not show anything......should I just type chmod u+x?
    • goo
      goo about 10 years
      I question your diagnosis. Simply running chmod +x ./java as root will not break access to $HOME. Do ls -ld $HOME;echo $HOME to show $HOME permissions, and to verify $HOME makes sense. My $HOME is mode 0700 (rwx------). sudo chmod u=rwx,g=,o= $HOME is my suggestion. sudo chmod u=rwx,g=rx,o= $HOME to allow group read and search. man chmod
    • user274219
      user274219 about 10 years
      ls -ld shows:dr-xr-xr-x 10 root root 2048 2011-09-23 21:47
    • wjandrea
      wjandrea over 6 years
      I agree with waltinator. It doesn't make sense for that command to change ownership and remove write permissions. Do you maybe have a wrapper on sudo or chmod? Also you didn't even need to run chmod as root, since I assume you're the file owner. (BTW I realize this is an old post -- just commenting for future readers.)
  • wjandrea
    wjandrea over 6 years
    According to the comments, the owner doesn't have write permissions, so OP will also need to run chmod u+w /home/user.
  • wjandrea
    wjandrea over 6 years
    And the group ownership was changed to, so instead of just user, use user: in the chown command.
  • wjandrea
    wjandrea over 6 years
    Also do you need to make it recursive? Aren't there files in the home folder that are supposed to be owned by root, or am I thinking of something else?