You are not logged in.

#1 2015-03-11 19:19:24

acm-i
Member
Registered: 2015-03-11
Posts: 5

[Solved] I broke my installation: file permissions gone crazy

Hello everyone!
It is a very embarrassing stituation I'm in because I have to take all the blame at myself. Somehow I managed to mess up the file and folder permissions of my system partition.
Small story: While working and testing in a hurry (not good, I know) I accidentally did chmod -R 777 to "/", instead of choosing the right folder. (Please don't laugh) After I closed my Gnome session and wanted to sign on again later, I was not able to log into the system anymore. Now I don't have any access to my system: my user password doesn't work, my root password doesn't work either.
I successfully managed to log into single mode, I also was able to get "into" the system via live CD and saved all my data.
It took me quite a while to realise that something must have gone wrong with the chmod command, but now I can see clearly:
While trying to reset my passwords (editing etc/shadow from single mode) I get messages like this one

sudo: /etc/sudoers is world writeable
sudo: no valid sudoers source found, quitting
sudo: unable to initialize policy plugin

I followed the given procedure for about 5 times now, always thinking that I must have made some mistakes. But now I decided to ask for help because it makes no sence anymore without knowing exactly which turn to make next.
So my basic question is: Can anyone help me to repair the system. Or should I go for a new install?
If a repair is possible please let me know which steps to take.

Thanks in advance.
Chris

Last edited by acm-i (2015-03-13 13:34:06)

Offline

#2 2015-03-11 20:07:34

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [Solved] I broke my installation: file permissions gone crazy

You should be able to change permissions freely from the live CD before you chroot. Start with the sudoers file, try to login again, rinse and repeat. To make things go faster, you can try reinstalling "base" to let pacman do some of the work for you, but you'll likely have some config files to chmod by hand.

arch-chroot /mnt
pacman -S base

or, if that doesn't work

pacman -r /mnt -S base

That should reinstall all of your base packages with the correct permissions, except for configuration files (which aren't touched). Remember to test gpg, ssh, or anything else that has strict permission requirements.

Edit: use `pacman -Qkk | grep -i permission` to check other packages.

Edit2: Before doing any of that, you might want to `chmod --recursive 644 /` or even 600 for security reasons, then continue with the top of this post.

Last edited by EscapedNull (2015-03-11 20:17:28)

Offline

#3 2015-03-11 21:22:29

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: [Solved] I broke my installation: file permissions gone crazy

EscapedNull wrote:

Edit2: Before doing any of that, you might want to `chmod --recursive 644 /` or even 600 for security reasons, then continue with the top of this post.

Before doing that, please read this:
https://wiki.archlinux.org/index.php/Fi … Bulk_chmod

You want the directories to be 755 and the files to be 644 (usually).

Last edited by Buddlespit (2015-03-11 21:24:37)

Offline

#4 2015-03-12 18:31:23

acm-i
Member
Registered: 2015-03-11
Posts: 5

Re: [Solved] I broke my installation: file permissions gone crazy

thanks guys!
I managed to get back into the system, using your advices.
Thanks a lot! I can't tell how grateful I am.

Cheers
Chris

Offline

#5 2015-03-13 01:29:18

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: [Solved] I broke my installation: file permissions gone crazy

Make sure you mark this thread [SOLVED], so when others have the same issues, they can go to a solution that works.

Offline

Board footer

Powered by FluxBB