Linux – How to log into database via script securely

linuxpasswordSecurity

I am wondering about whether it is acceptable (security-wise) to have database login credentials (user/pass) set in an environment variable or passed in as a command-line parameter?

Both of these methods seem risky to me as perhaps others can read the environment variable or read the running processes/history and credentials would be there in plain-text (Is my understanding correct here?)

What would be an acceptable way to do this login? It would be run in a script as part of an automated job/process.

Edit: This is an Oracle database (11g)

Edit #2: Oracle Wallet was considered at one point, but can't be used yet where I work.

Best Answer

I'm not really experienced with Oracle databases (or databases for that matter), but it seems a Perl solution is possible with Oracle wallet as shown here (Google search terms "oracle database passwordless login").

Related Question