by sinsudo · 6mo ago · 0 comments
Edited: Previous suggested using \sudo but it depends of the variable path which can be modified by the attacker.
$ /usr/bin/sudo() { echo Not the real sudo.; }
$ /usr/bin/sudo
Not the real sudo.
And every other suggestion also doesn't work if the attacker can just replace the shell.
Password on sudo is only useful if you detect the infection before you run sudo
In practice yubikey sudo keeps you much safer today, as almost nobody uses it and malware won't be prepared for it
Yubikeys do not fix this issue.
Plus you only need one slip-up and you're hosed. Even people who try to almost always use '/usr/bin/sudo' will undoubtedly accidentally let a 'sudo' go through. Maybe they copy/paste a command from somewhere (after verifying that it's safe of course) and just didn't think of the sudo issue then and there.
Many package managers require sudo, sure, but there is no good reason for them to in a modern linux system, and not all require this.
Even with systemd, you can use systemd --user.
Honestly, the Android approach is significantly better. (and for that, see Micay's various ramblings posted online)
If your unprivileged user is compromised, you are pretty hosed.
Like, sure you could, but you end up with a very useless system.
Easier to just use VMs for each security context.