My situation is not very commo, or very comm for someone. I need to save some passwords in a database. Let me explain what I really need.
I have several servers that I need to access 3 times a day, every day, for a year, is a kind of non-stop service, the SSH service works in each of them, and I also have software that requests access to each of servers 3 times a day. Well, everything works fine as I want, the problem is PASSWORD! How to manage all passwords!
Today I have all the server passwords in the script (the same script that actually runs the SSH services), since I use SSH2 PHP Functions ssh2_auth_password() for authentication on the servers, but this is plain text.
how about this ssh2_ auth_ pubkey_ file() function? How do i use this?
Is it safe to store a password in my own scripts? I do not think so..
Then what to do in this case? If I save the password in the database, I will need to get a password for each request to the server (it is executed by cron), and if it is a hash, I can compare it with another hash in my script and return the plain text for my authenticate function, as before plain text .. (but I think this is not the best solution yet!).
EnCrypt passwords, then decrypt passwords every server request? maybe maybe ..
Does anyone have any ideas what is best to do in this situation?
I'm in the pool!
Thanks in advance for any light!
[EDITED]
My Arch is the Linux 2.6 kernel, most of which, the SaaS application runs on an external (neutral server) and CronJobs regularly work 3 times a day, all automatically on the command line, without human interaction.
[EDITED ONCE MORE]
Where should I generate a key pair? Is only one key pair enough for all my servers, including the SaaS APP server? or do i need to generate one at a time? A bit confused.
CRON JOBS (fire servers) 3x/day ------------ | SaaS APP |________________________ ________------------_______ | | | | | | | | | ----------- ----------- ----------- | | SERVER1 | | SERVER2 | | SERVER3 | .... SERVER4 .... ----------- ----------- -----------
Thanks again!