I learned from my earlier question What's the purpose of using `sudo -S` explicitly? that sudo accepts password not from stdin by default.
Why is that? Is it because of some security reason?
I learned from my earlier question What's the purpose of using `sudo -S` explicitly? that sudo accepts password not from stdin by default.
Why is that? Is it because of some security reason?
It's often useful to pipe input into sudo, such as being able to do echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope without the 0 being interpreted as the sudo password. If sudo accepted the password from standard input, that wouldn't work.