Ubuntu – Resetting /home permission

home-directorypermissions

I changed the permission of /home folder to 777 and now I cannot access my account and login only as a guest (Ubuntu 14.04) with no sudo support.

Permission in home folder is as follows:

drwxr-xr-x 134 root root 12288 Dec 14 11:47 etc
d---------   4 root root  4096 Dec 14 09:50 home
drwxr-xr-x  24 root root  4096 Dec 11 23:04 lib
drwxr-xr-x   2 root root  4096 Dec  4 18:05 lib32
drwxr-xr-x   2 root root  4096 Dec  4 18:05 lib64
drwx------   2 root root 16384 Nov 30 23:42 lost+found

I will appreciate if there is a fix other than reinstall.

Best Answer

You must boot into recovery mode:

a- Switch on your computer.

b- Quickly press and hold the Shift key, which will bring up the GNU GRUB menu.

c- Select the line which starts with ---- Advanced options.

d- Select the line ending with ----- recovery mode,something like:

Ubuntu GNU/Linux, with Linux 3.16.0-28-generic (recovery mode)

e- Your PC should display a menu with a number of options.

f- Select the line with ---- Drop to root shell prompt.

g- You start in a terminal as root with the root partition mounted read-only.

Run it:

mount -o remount,rw /
mount --all
chmod 755 /home
chmod -Rf 700 /home/raj
chown -R raj /home/raj
reboot