I had a weird situation where I had a root shell on a remote Linux server that was experiencing a file system issue. No userspace commands were working except my shell builtins (echo, cd, and so on). I decided to reboot, but the "reboot" command, "init 6", "systemctl reboot", and "shutdown" commands wouldn't work. I couldn't visit the system in person and there was no remote power option.

Just a reminder that when all else is lost you can hard reboot a Linux system remotely via /proc/sys (assuming you happen to have a root shell on the machine):

echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

This is a hard reboot. There's no file system sync, your databases go down hard, and this can really ruin your day. But just remember this little trick if you get painted into a corner.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://infosec.exchange/users/hal_pomeranz/statuses/115220370083388046 on your instance and quote it. (Note that quoting is not supported in Mastodon.)