1

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?

Sean
  • 191
  • 1
  • 5
  • is the same, exact username and password used when testing the script on the machine that works and the one that doesn't? – jschorr Sep 29 '11 at 22:59
  • Are you using MySQL? Make sure this remote host has been granted permissions to connect. – Alpha01 Sep 29 '11 at 23:47
  • 1
    @Alpha01, no, it's not using MySQL. It's using Oracle, and I know that part is working because it is creating the files. I asked someone who can access this machine to get all of the gems installed. Possibly this is gem issue? – Sean Sep 30 '11 at 01:30

2 Answers2

1

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!

Sean
  • 191
  • 1
  • 5
0

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?

jschorr
  • 3,034
  • 1
  • 17
  • 20
  • I will look at that as soon as I am able to. Thanks so much for giving me alternative areas to look! – Sean Sep 30 '11 at 20:30
  • All indications appear to be SSH related. [http://www.brandonhutchinson.com/wiki/Red_Hat_Bug_124602_In_Action](http://www.brandonhutchinson.com/wiki/Red_Hat_Bug_124602_In_Action) – Alpha01 Oct 01 '11 at 00:05