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.

share|improve this question
    
sorry, to clarify the permission of home directory shows up as : d--------- 4 root root 4096 Dec 14 09:50 home – Raj Dec 14 '14 at 19:14
    
If PolicyKit is installed, try pkexec chmod 755 /home, I'm not sure, but let's see if it do the trick. – Lety Dec 14 '14 at 20:28
    
Try this it is about a different problem, but you can found how to enter into GRUB and get root privilege, so you could change /home permission with chmod 755 /home. – Lety Dec 14 '14 at 20:41

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
share|improve this answer
    
Alternatively you can press Ctrl+Alt+F3 and run the same commands (excluding the mount commands) as sudo. Thanks for this answer btw, helped me out after I totally stuffed my home dir permissions :P – Clonkex May 3 '17 at 2:04

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.

share|improve this answer
    
I can only login as a guest which does not support sudo command! – Raj Dec 14 '14 at 19:59
    
now root own home and I as a guest I cannot see what is inside home! – Raj Dec 14 '14 at 20:00
1  
chmod can't change the owner, that must've happened before. ProTip: You can change the owner with chown – Xen2050 Dec 14 '14 at 20:05
    
that also requires sudo access which guest account does not allow. – Raj Dec 14 '14 at 20:10
    
since /home is now owned by root and I have setup root pw I cannot access /home. Is there a way to set root pw while loged on as a guest (with no sudo access)? – Raj Dec 14 '14 at 20:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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