TIL that if you inadvertently alter the permissions of /, you're gonna have a bad time.
I've been tinkering with an install of Arch Linux and, somehow, things stopped working correctly. I could still boot into the system, but most of the boot services were failing, much to my bewilderment. I tried fsck, I checked and re-checked the permissions and syntax of many configuration files, until it dawned on me that I should check the permissions of the root. Much to my surprise, I found that the permissions were 0644 rather than 0755. A quick fix solved everything and prevented a needless reinstall.
TL;DR I'm a dumbass and shouldn't be allowed to use Linux.
About this post
- Posted
- Archived
- Score
- 41 · 100% up
- Kind
- Text
- ID
- ui30b
35 comments
Don't worry about it. Breaking your system is the best way to learn Linux!
this is very true. every break brings wisdom.
I'm actually a longtime Linux user, I've just never managed to break my system in this particular fashion. Imagine my surprise when I was forced to admit that I still don't know everything there is to know.
The question I'm wondering is how did you manage to inadvertently change your root permissions?
Deleted before we saved it.
Is it..? Breaking your system once for every possible way to break your system sounds very time consuming to me. I prefer to learn without breaking anything. Sure, without the drama I will sometimes forget things, but the saved hours should be plenty to relearn those.
In my humble opinion even though it is time consuming to break your system, you will learn a lot from it. You often learn things that are unrelated to the crash, and you learn you how to fix problems and do troubleshooting which is an important skill in many circumstances.
If you just get the answer from internet or posting in a forum, you will not learn as much as if you manage to solve the problem yourself, hence you will not be as efficient when using your computer.
I'm with you. No sense in intentionally fucking up your system. I don't have time for that.
Not sure why you are 0 points when I got to your post, I knew this has bad consequences.
Why? Because quite a while ago somebody I know broke their system doing this and told me about it, so I don't have to break my system this way. In this case breaking my system is not he best way to learn, I can just learn from somebody else's mistakes.
Okay, admit it. You just tried to make them feel better.
I concur; just remember to keep routine backups of anything you don't want to lose, and you'll be fine!
oh fuck, I was in / !
Sigh. unplug
SysRq + REISUB
Yeah, but once the whole filesystem permissions are wrong, it won't ever boot again anyway
Deleted before we saved it.
Nah, I just reinstalled. I just copied my /etc partition first, and in half an hour my server was back and running.
Deleted before we saved it.
$chmod -R 660 .
permission denied: /
( good thing I don't randomly sit around as root)
I was once developing a website on my localhost, but my user account didn't have the right permisions for /var/www. It took me a while to figure out how to set permissions.
And then it seemed like a good idea to just set every single file and folder on my system to 0777. I'd never have any issues with permissions ever again! So chmod -R 0777 / it was.
And then pretty much everything stopped working.
Most security software expects certain files and directories to have certain permissions, so this isn't surprising.
I ended up reinstalling linux, I was getting too many of errors. I started out resetting all the permissions, but that was just way too time consuming.
I did learn a lot about permissions in the process, so that's something.
This is what happened to me a few weeks ago.
I saw that Ubuntu (or something else Debian) symlinked /lib64 to /lib on a 64 bit system. In a moment of epiphany, I thought "what a neat idea, let me do this on all my ArchLinux machines".
About a week or two after that, there was an update to a library in /lib which also had to be symlinked to /lib64. The library happened to be ld-linux-x86-64.so As you can imagine, the original library was replaced by the symlink and this is when shit hit the fan.
You have to understand that I did not immediately know what happened as all of my binaries stopped working. The system would not boot. Checking the error logs from a live session was not helpful. I asked on the IRC, people genuinely offered the best of their knowledge. But in the end, I was asked to wipe the system.
Not wanting to give up just yet, and looking at the pacman log (as suggested by a really helpful fellow archer), I read something about symlinks and remembered the stupid hack I made weeks ago.
Thank fully, I had my older laptop with a similar setup and packages. I removed /lib and /lib64 and rsync'd that shit (dangerous I know, but better than wiping the hard disk and starting over).
Mentioned this on the IRC, and many lol's were had.
Shitty part: I did the same on two of my work computers and forgot about it. The update killed both of them.
TL;DR Symlinked /lib and /lib64. Broke everything. On three computers. rsync saved the day.
Yeah, the symlinking of lib to lib64 is for multilib machines.
chown -R www-data:www-data /
I did this on a box my friend used for her hosting company.
Oh that made me cringe...
Nope. You're a user who just learned something. :)
But I'm not a noob.
Corrected to affect reality.