You are not logged in.

#1 2023-01-03 02:55:04

testuser42069
Member
Registered: 2023-01-03
Posts: 1

Accidentally changed perms in the whole /

Gentlemen, I have possibly made a mistake comparable in magnitude to sudo rm -rf:

sudo chmod -Rv 0777 /

- while trying to fix an encrypted drive being read-only, thinking that Dolphin's "Open terminal here" would do the trick. It did not.

The question is, thus: is there even a coming back from this, or should I just pack up and reinstall? I have no clue what permissions the directories in / need. If someone could give me pointers, it would be greatly appreciated.

Thank you.

Currently not turning off the system, but I am due for some shut-eye.

[EDIT] Naturally, I don't have Timeshift set up. Not sure it'd even help in this case, though.

Last edited by testuser42069 (2023-01-03 03:34:48)

Offline

#2 2023-01-03 04:52:10

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: Accidentally changed perms in the whole /

Do you have the output from that command? If so you could reverse it just using that output.

$ chmod -Rv 0777 /tmp/chx
mode of '/tmp/chx' changed from 0755 (rwxr-xr-x) to 0777 (rwxrwxrwx)
mode of '/tmp/chx/b' changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of '/tmp/chx/a' changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)

shows that I'd want

$ chmod 0644 /tmp/chx/[ab]
$ chmod 0755 /tmp/chx

Otherwise, there is no straightforward way to reverse what you've done, as far as I know. You can run a check for files which differ from those in packages, but not all files should have the same permissions as those in the packages. There is also the problem of directories not managed by pacman, which means at least $HOME and possibly more.

Edit: See https://bbs.archlinux.org/viewtopic.php?id=280139. The problem is not the same, but it is similar. seth's post may be helpful, except you'd want to extract permissions rather than ownership.

Last edited by cfr (2023-01-03 04:59:23)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB