3

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.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
Raj
  • 31

2 Answers2

7

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
kyodake
  • 17,808
0

You want your /home permissions the same as /etc or /lib... I don't know the chmod numbers but these should do it:

sudo chmod a+rx /home
sudo chmod u+w /home

If you recursively changed all the folders in /home then you'll have some recursive (-R) chmod'ing to do, and is your user still the owner of his own home? If not, use chown (probably sudo chown unless you're root at the time) and change back to the the rightful owner.

Xen2050
  • 8,943