title: Best practices for holding passwords in shell / Perl scripts?
body: <p>I've recently had to dust off my Perl and shell script skills to help out some colleagues. The colleagues in question have been tasked with providing some reports from an internal application with a large Oracle database backend, and they simply don't have the skills to do this. While some might question whether I have those skills either (grin), apparently enough people think I do to mean I can't weasel out of it.</p>
  
  <p>So to my question - in order to extract the reports from the database, my script is obviously having to connect and run queries. I haven't thus far managed to come up with a good solution for where to store the username and password for the database so it is currently being stored as plaintext in the script.</p>
  
  <p>Is there a good solution for this that someone else has already written, perhaps as a CPAN module? Or is there something else that's better to do - like keep the user / password combo in a completely separate file that's hidden away somewhere else on the filesystem? Or should I be keeping them trivially encrypted to just avoid them being pulled out of my scripts with a system-wide grep?</p>
  
  <p>Edit:
  The Oracle database sits on an HP-UX server.<br>
  The Application server (running the shell scripts) is Solaris.<br>
  Setting the scripts to be owned by just me is a no-go, they have to be owned by a service account that multiple support personnel have access to.<br> 
  The scripts are intended to be run as cron jobs.<br>
  I'd love to go with public-key authentication, but am unaware of methods to make that work with Oracle - if there is such a method - enlighten me!</p>