Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No. That’s a blanket statement on your part that you cannot make because you don’t know what my scripts look like, or what commands they call.


No, it's never better to run whole scripts as root when root is only required for part of it. Unless every expression in your script requires root, the blanket statement holds.

In my experience, and in my own scripts, it is better to explicitly check if you are being run as root, advise against it and exit (with maybe some break glass flags) and invoke sudo when escalated privileges are required.


Yes, it's a blanket statement, better it's an absolute statement because it's absolutely true.

You're taking a shortcut due to convenience and it's bad security practice.

It's that simple.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: