Try to use Expect to answer the passwd question.
| [reply] |
Better than hardcoding a password in the source is to make it so you're not prompted to begin with. If you're trying to run something like ssh or rsh, setup an SSH identity or .rhosts file. If you're trying to run a command as a different user, use sudo and configure it so that the script can be run as the specific target user by the running user without a password.
| [reply] |
You haven't really given enough information to say (what command are you running? What authentication is it, system(user)/database/other?) but sudo maybe the answer to your question.
-- Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
| [reply] |
I am trying to automate some maintenace work in the Oracle Calendar. For that particular task, a password is needed. I am trying to figure out a way not to hard code the password, but it doesn't seem to be possible (thought about putting the pwd in a file only readable by crontab, but it can be easily defeated). Any other suggestion?
| [reply] |
I'm not familiar with Oracle Calendar at all, it sounds like the only solution might be to put the password in a file, I have had to do that before for Oracle interfaces. It would be nicer if Oracle allowed the use of keys which at least wouldn't be plain text viewable, you would still be relying on file system (permissions) security though. If a cracker has bypassed file system security you probably have bigger problems...
-- Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
| [reply] |