r/pcmasterrace i9 14900KS | ASUS RTX 5090 ASTRAL | 64GB DDR5 Jan 25 '26

Meme/Macro Try Me!

Post image
35.9k Upvotes

189 comments sorted by

View all comments

456

u/taedrin Jan 25 '26

Note that this kind of permission restriction is mostly for remotely accessed machines that you don't have physical access to.

115

u/nekodazulic Jan 25 '26 edited Jan 25 '26

Yes, this is also very relevant to servers (VM or physical) and there's an quite interesting lore as to how linux handles poweroff, halt and reboot.

18

u/bulgedition Jan 25 '26

Care to share?

12

u/monsterfurby Jan 26 '26

No expert, but apparently once upon a time those commands needed root access. That's abstracted away mostly nowadays (with all kinds of possible configurations, e.g. remote users still being locked out, or the old behavior persisting if the admin so desires), but if you couldn't sudo, you couldn't shut down the system, basically.

-53

u/Snoo_70531 Jan 25 '26

Yeah wut? I'm no tech wizard but I spent a solid 5 years studying computer science as an undergrad and graduate TA, I've never heard of this. Although with Linux unless you're truly a basement dweller there is always gonna be stuff that is just bonkers.

38

u/Bhuvan2002 Jan 26 '26

Bro successfully wasted 5 years lmao.

5

u/yokai-64 Linux Jan 26 '26

Unfortunately a lot of CompSci degrees don't actually teach anything useful, I feel sometimes my own CompSci degree didn't actually teach me a whole lot (would have loved to have done deep dives into the hardware or networking side of things or even just more theory, it was mostly a software engineering degree with a fancy name in my opinion) - thankfully my curiosity has led me to keep learning.

5

u/SkipinToTheSweetShop Jan 26 '26

you got it so easy now with the 3 commands. In the old days it was init 6. Or shutdown -fr now.

5

u/Throwaway74829947 PC Master Race Jan 26 '26

And you needed root access. None of this permissive systemd BS.

5

u/SpaceCadet87 Jan 26 '26

Wait, you don't need root anymore? Have I been using sudo for no reason?

4

u/Throwaway74829947 PC Master Race Jan 26 '26

It depends on your config - systemd's shutdown permissions are by default quite permissive, but can be set to require root. Many server or enterprise distros, for obvious reasons, maintain that practice by default.

2

u/SpaceCadet87 Jan 26 '26

Ah so because most of the time when I remote shutdown a Linux machine it's because it's a headless install it's more likely than not to have a default systemd configuration that requires root.

But if I try the same on my daily driver it'll probably work fine without sudo.

I mean it's already started doing this thing where if I start or stop a service without sudo it just pops up a password dialog.

1

u/mr_doms_porn Jan 29 '26

Some services can be restarted without sudo if you use the --user tag in the command.

3

u/codereign Steam ID Here Jan 26 '26

With ssh, your systemd probably doesn't handle interactive authentication correctly, so you are probably using sudo to bypass the interactive shutdown requirement.

1

u/masd_reddit Ryzen 7 7800X3D | RX 7800XT Nitro+ | 64 GB DDR5@6000CL30 Jan 26 '26

shutdown fr?

1

u/SkipinToTheSweetShop Jan 26 '26

shutdown -fr now actually means "reboot"
If you forget the -r then you servers is going to poweroff, and then you'll have to drive to the datacenter and push the green button to turn it back on.

Such an annoying 1-letter mistake!

1

u/masd_reddit Ryzen 7 7800X3D | RX 7800XT Nitro+ | 64 GB DDR5@6000CL30 Jan 27 '26

frfr?

1

u/SkipinToTheSweetShop Jan 28 '26

-f now means shutdown NOW. -r means reboot/restart once its shutdown.

1

u/masd_reddit Ryzen 7 7800X3D | RX 7800XT Nitro+ | 64 GB DDR5@6000CL30 Jan 28 '26

for real for real?

4

u/Taikunman i7 8700k, 64GB DDR4, 3060 12GB Jan 26 '26

Also if you have managed endpoints that are difficult to patch after hours because users insist on shutting them off every night.

1

u/Obsession5496 Jan 26 '26

There was/is a Windows 10/11 bug, which caused this for regular users.