Is there a unix service, or at least one I could cobble together, for storing a plaintext password for a PHP web application?
In composing this question, I found that c# provides a service for storing passwords in an encrypted format.
I have to store plain-text passwords because the application is connecting to various ftp servers. Not all of these servers are configured to use public keys. The two vectors I'm looking to protect against are database dumps and someone getting the plaintext password from a file on the filesystem.
I was wondering if there is some way that the server OS itself can store an encrypted string for the user that the app is running under -- apache
, www-data
or whomever. I understand that such a system is still vulnerable to someone getting the access to those accounts, or uploading malicious PHP scripts, but I feel that with our current practices, those are acceptable risks. I am just looking not to store the plaintext password in the db or on the filesystem.