I am troubleshooting a ruby script that queries a database, creates a csv, and sftps it to another server. The server the script is on is a rhel box, running ruby 1.87 I believe.
Here’s the code that does the sftping:
Net::SFTP.start(sftp_site, sftp_user, :password => sftp_pswd) do |sftp|
sftp.upload!(local_filepath,sftp_dir+filename)
end
When executing the script, there is a curious message before it bombs out:
Password Reset
Your password has expired. You are required to change your password to proceed.
This script works on another server, but not this one. A user can sftp from the prompt on this machine. SELinux has been turned off, as it may have had some interference.
Anyway, point being, does anyone have any ideas?
It appeared to be a gem issue (though someone in networking may have worked some magic I am unaware of). The production server had older versions of the net/ssh and net/sftp gems. It had version 1.1.1 and version 1.1.2, respectively, and upgrading those gems to a later version fixed the issue.
Thanks for everyone who offered suggestions!