开发者

ruby sftp error password reset

开发者 https://www.devze.com 2023-04-09 04:21 出处:网络
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.

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!


I would compare the sshd daemon settings (sshd_config), as there's likely an issue in the server that's not working. Perhaps interactive-keyboard authentication is turned on or something like that?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号