Why echo 'password' | sudo -S sudo -s does not work whereas echo 'password' | sudo -S mount -a works?
Ralf Mardorf
kde.lists at yahoo.com
Mon Feb 8 14:02:08 UTC 2021
On Mon, 8 Feb 2021 08:23:35 -0500 (EST), Robert Heller wrote:
>Even better, just run the whole srcipt with sudo
While it could be better, it also could be even more worse than even
the echo password approach, since it is asking for privilege escalation
depending on what the script does, for example when sometimes accessing
the Internet.
However, I agree that the echo password approach is bad, but I
refrained from acting as a teacher, since it's not that seldom, that
software doesn't behave much better and the question wasn't about
security. While it's frowned upon, some apps require plain passwords in
human readable config files and just recommend to use very restricted
file privileges. Don't ask me for examples. I've seen a few apps doing
this, IIRC command line mail clients. I don't tend to follow this
attitude.
More information about the ubuntu-users
mailing list