Obligatory DO NOT RUN THIS ON YOUR COMPUTER (or anyone else’s).
You’d think with fully open permissions, everything would work better, but many programs, including important low level things, interpret it as a sign of system damage and will refuse to operate instead.
If you do run it, you’d better have a backup or something like Timeshift to bail you out, and even if you do have that, it’s not worth trying it just to see what will happen.
It’s not quite as bad as deleting everything because you can boot from external media and back up non-system files after the fact, but the system will almost certainly not work properly and need to be repaired.
One of our servers is a rotting carcass being kept alive by our collective prayers. It runs Windows 7 and custom software whose developer is dead and the source is missing, nothing has been updated for over a decade, and it has its own independent UPS because once it goes down, it has an extremely slim chance of recovering, and we’re afraid to test it. It controls the card entry system into the building, including the server room. Boss doesn’t want to replace it because we’d have to replace all of the terminals and controllers too, and it hasn’t catastrophically failed yet.
You’re right. It’s not a pet. It’s like one of the Saw movies: if it dies, we’re all fucked.
The question I often ask clients who think this way is "How much would it cost if it did fail? Let’s say this happened today. What would be the cost to replace it NOW and not only that but make sure people who are working can still do so with the interruption?
Now how much would it cost to schedule the interruption and manage the fall out in a way that is controllable?
For some, the catastrophic failure points to “hey I fixed the thing!” And the incentives for that kind of person are different from the person whose job is to mitigate risk.
It sounds like your boss is the former. In which case it’s going to be fun when it fails.
It’s surprisingly easy to get from the main hall to the server room. There are two doors between the entry hall and the server room, one can be bypassed by yanking it real hard, and that gives access to the breaker box for the electromagnets among others. The building is not particularly well-designed.
I’m sure there’s a good reason (or at least a believable reason) but I’m curious now, why can’t copies be made of the binary/data and start trying to get it running on a VM or another box?
The reason is that we want it to fail. My original comment was more emotive than descriptive. The system is horribly designed and a fucking menace on the best day, so short of direct sabotage, we’re doing what we can to force the bossmang to replace it.
I learned this relatively quickly running my own server with the intention of my family also using it. Data on a separate drive, backed up regularly and automatically. System on it’s own drive, dd’d when it’s in it’s final state and backed up before I screw around any deeper than trying out a new container. I can bring my server back up in however long it takes to transfer data.
I did this once by accident (bad scripting, managed to abort it,) it wasn’t too bad until sudo told me that the sudoers file had the wrong owner. I then learnt that there are other ways to become root.
OS ran for another ~6months after I re chowned etc to root.
Someone actually ran it on a server at my workplace, trying to fix file permissions on a samba share. Broke SSH and the samba daemon. Thankfully I was able to fix by removing the permissions from the config files the error logs pointed to.
Just saying, I think it was a ChatGPT idea, other people use it every day. I only use it if I’m completely stumped, and only take it as suggestions.
It sets permissions (ch ange modification rights) on all files (-R = recursive, stepping down through directories) in the file system (hence starting at /) so that they can be read, (re)written and executed as programs by all users (the 777 part). 000 would be no permissions for anyone (except for the root user), which would be just as bad.
Excellent summary. Just as a bit of trivia I’ll add that Linux file permissions go like r w x (read write execute) = 4 2 1, so taken all together a 7 means the indicated user can do all those operations.
And yeah, it breaks your system in surprising ways. Most people would just have to start over.
Obligatory DO NOT RUN THIS ON YOUR COMPUTER (or anyone else’s).
You’d think with fully open permissions, everything would work better, but many programs, including important low level things, interpret it as a sign of system damage and will refuse to operate instead.
If you do run it, you’d better have a backup or something like Timeshift to bail you out, and even if you do have that, it’s not worth trying it just to see what will happen.
It’s not quite as bad as deleting everything because you can boot from external media and back up non-system files after the fact, but the system will almost certainly not work properly and need to be repaired.
You have been warned.
I will make a disclaimer. Thanks.
New guy at work ran this to try to fix permissions on his home folder, accidentally ran it on root (both would have been bad)
Several highly paid and experienced Linux admins finally just gave up and deleted the server and built a new one from the backups.
Which, honestly, is the better way to go. Treat your compute resources like cattle, not pets.
One of our servers is a rotting carcass being kept alive by our collective prayers. It runs Windows 7 and custom software whose developer is dead and the source is missing, nothing has been updated for over a decade, and it has its own independent UPS because once it goes down, it has an extremely slim chance of recovering, and we’re afraid to test it. It controls the card entry system into the building, including the server room. Boss doesn’t want to replace it because we’d have to replace all of the terminals and controllers too, and it hasn’t catastrophically failed yet.
You’re right. It’s not a pet. It’s like one of the Saw movies: if it dies, we’re all fucked.
So… the dead server controls who is even able to enter the building? Wow. That is one big juggernaut of a problem heading for you.
Typically a brick can control who can enter the building. Security man the doors for a few days until the new system is in.
The question I often ask clients who think this way is "How much would it cost if it did fail? Let’s say this happened today. What would be the cost to replace it NOW and not only that but make sure people who are working can still do so with the interruption?
Now how much would it cost to schedule the interruption and manage the fall out in a way that is controllable?
For some, the catastrophic failure points to “hey I fixed the thing!” And the incentives for that kind of person are different from the person whose job is to mitigate risk.
It sounds like your boss is the former. In which case it’s going to be fun when it fails.
I gönne be honest, it sounds kinda stupid to be reliant on a server to open the door to the same server.
It’s surprisingly easy to get from the main hall to the server room. There are two doors between the entry hall and the server room, one can be bypassed by yanking it real hard, and that gives access to the breaker box for the electromagnets among others. The building is not particularly well-designed.
I’m sure there’s a good reason (or at least a believable reason) but I’m curious now, why can’t copies be made of the binary/data and start trying to get it running on a VM or another box?
The reason is that we want it to fail. My original comment was more emotive than descriptive. The system is horribly designed and a fucking menace on the best day, so short of direct sabotage, we’re doing what we can to force the bossmang to replace it.
I learned this relatively quickly running my own server with the intention of my family also using it. Data on a separate drive, backed up regularly and automatically. System on it’s own drive, dd’d when it’s in it’s final state and backed up before I screw around any deeper than trying out a new container. I can bring my server back up in however long it takes to transfer data.
Why does he have rights to use sudo in the first place?
One time I introduced someone to Linux then left them to their own devices.
I returned to them hours later to find out they had gotten annoyed with permissions errors and run
chown -R ${THEIRUSER}: /
.The results were not what they wanted.
A valuable lesson
I did this once by accident (bad scripting, managed to abort it,) it wasn’t too bad until sudo told me that the sudoers file had the wrong owner. I then learnt that there are other ways to become root.
OS ran for another ~6months after I re chowned etc to root.
Wow. You were lucky. That abort might have been what saved you there.
Someone actually ran it on a server at my workplace, trying to fix file permissions on a samba share. Broke SSH and the samba daemon. Thankfully I was able to fix by removing the permissions from the config files the error logs pointed to.
Just saying, I think it was a ChatGPT idea, other people use it every day. I only use it if I’m completely stumped, and only take it as suggestions.
But how else will I make everything work without issues
What exactly does that command do
It sets permissions (
ch
angemod
ification rights) on all files (-R
= recursive, stepping down through directories) in the file system (hence starting at/
) so that they can be read, (re)written and executed as programs by all users (the777
part).000
would be no permissions for anyone (except for theroot
user), which would be just as bad.Excellent summary. Just as a bit of trivia I’ll add that Linux file permissions go like
r w x
(read write execute) =4 2 1
, so taken all together a7
means the indicated user can do all those operations.And yeah, it breaks your system in surprising ways. Most people would just have to start over.
gives all users on the system read and write access to any and all files and resources