3 ms·
Which is a good reminder that password entry is terrible security wise. With macOS, you can sudo authenticate with your Apple Watch, which is really nice.
by toxik 6y ago
Which is a good reminder that password entry is terrible security wise. With macOS, you can sudo authenticate with your Apple Watch, which is really nice.
- majewsky 6y agoIf you're concerned that a script's root password prompt may be a forgery, you can run "sudo -v" before executing the script. For background, there is a convenience feature in sudo: It only requires your password prompt if you have not had a successful sudo invocation in the same terminal in the last X minutes (5 minutes, I think? not sure on the exact value). "sudo -v" is a special invocation which does not actually execute any command, but it renews your 5-minute lease. ("sudo true" is effectively equivalent, though not idiomatic.) So if you're executing a short script that needs sudo, run "sudo -v" before running the actual script. Then you know that if a root password prompt pops up again, it's not really sudo who's asking.
- gruez 6y ago> If you're concerned that a script's root password prompt may be a forgery, you can run "sudo -v" before executing the script. The bigger problem is that even without sudo or your root password, malicious scripts can do a lot of damage. ie. they can add a fake sudo to your .profile, so you next time you try to do "sudo -v" your password still gets stolen.
- jereees 6y agoIs this a feature built in into the OS? I have only heard of some third party code to allow that…
- toxik 6y agoIt's not built-in for sudo, which is surprising. It is however for many other authentication prompts.