News for hackers. Stuff that matters.
Re:Some Differences Between macOS and Common Unix Systems by theamk on Friday December 25, 2020 @09:58PM (#25540986)
I always thought that one of the big purposes of "sudo" is to prevent operator errors. For example, if I want to inspect the .deb file and accidentally type "dpkg -i" instead of "dpkg -I". Or if I am examining logs on a server, and mistype ">" and "<". Or if I typed "make install" and failed to set PREFIX to a local directory.

It also helps a lot as a voluntary "logging" solution -- if you collect syslog on your servers, this can record which commands got run and why things got worse. It is not security solution, you'll have to make a "social convention" to never do "sudo su" or invoke ! in your editor, but it helps to detect accidental mistakes.

As for secure console, you can do this today! Make sure "k" is enabled in magic sysrq flags, and then you can switch to VT1 (alt-ctrl-f1) and invoke SAK with alt-sysrq-k. This'll kill everything on the current VT, and give you a clean login prompt which you can safely log into.

Finally, even with a single user, the privilege separation can help a lot with data protection. Just set up a backup process to run as root, into local directory where only root can write to. Then at least your data won't get deleted.

Re:Some Differences Between macOS and Common Unix Systems by segfaultbuserr on Friday December 25, 2020 @10:37PM (#25541190)
> I always thought that one of the big purposes of "sudo" is to prevent operator errors.

Good point.

> As for secure console, you can do this today! Make sure "k" is enabled in magic sysrq flags

Thanks. I thought I was SysRq-literate as I frequently use the key for OOM killer, emergency sync and reboot. But it appears I was too ignorant to know the SAK. Just learned something new today.