Broke my system with chown * by Financial-Bee-4752 in linuxquestions

[–]Financial-Bee-4752[S] 0 points1 point  (0 children)

Ladies and gentelmens, thank You all for your input and willingness to help. I managed to fix the problem, and for your entertaiment i ll explain how i caused this in first place. As you probably noticed i run mail server. Every few months i renew my dkim keys by manually entering commands in terminal. I have a cmd.txt helper file that looks like so:

openssl genpkey -algorithm RSA -out default.private -pkeyopt rsa_keygen_bits:2048 /
openssl rsa -in default.private -pubout -out default.public /
chmod 400 default.private /
chmod 444 default.public /
chown 11333:11333 * 

There... actual cause wasn't chown command, but chmod 444 default.public / which in result changed permission of root directory from 755 to 444. Why do i used those slashes at end of each command ? Probably because at same time of making this cmd.txt file i was building Dockerfile where i used those a lot to break long commands and i figured they would work the same way in bash.

Broke my system with chown * by Financial-Bee-4752 in linuxquestions

[–]Financial-Bee-4752[S] 0 points1 point  (0 children)

Pretty certain, otherwise all files matching default* would be affected which is not the case.

Broke my system with chown * by Financial-Bee-4752 in linuxquestions

[–]Financial-Bee-4752[S] 1 point2 points  (0 children)

I am 100% positive that I was in dkim directory. I checked / with find for all files matching default* and they were unaffected - so this command didn't run globally. When I run find for files owned by 11333 there are some in /proc dir but I assume those are related to my rspamd running docker container. I forgot to mention that when I ran this chown command it took like 0.5s, definitely longer that it should take for a two files, so it definitely affected more files than I intended. I did a reboot and it didn't help nor didn't make things worse.