I have the need to upload a set of files to an sftp account.
My first thought was to use php's ssh2_connect() function and I was able to get this working locally no problem. However, once I moved to the dev environment I quickly realized that this wasn't a good solution because there are too many dependencies that wont exist and installing them would require too many approvals from too many people.
So, my next thought was to use bash, and this is where I need help. I will be running this bash script every hour through cron, so it needs to be unattended. However, when I run sftp/scp it requires a password.
The sftp account does not allow ssh connections so I cannot create authorized keys. I don't want to rely on the .ssh folder on the remote machine as well.
Any suggestions would be appreciated.
Keep in mind I cannot install anything, so no keychain, sshpass or expect. All other answers found in How to run the sftp command with a password from Bash script? are not feasible as I cannot install anything on the server.