I would like to know if there is a safe way to only be queried for a password once in a custom bash script, and then save it somehow to be used for later needs. At the end of the script it should be shredded in some way so it wont not recoverable from memory or in any other way.
Take the 2-minute tour
×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
Use a
in your script. Of course, you need to previously encrypt it:
|
|||||||||
|
sudo
and it would remember the password. If you're trying to authenticate to a database or similar it would be more complicated. Just tell us what you want to do. – Andreas Wiese Apr 18 at 19:53