SSH question on Red Hat 7.2

I am having a problem authenticating using sftp2 from a batch file I run.  I run this batch file from home computer (win2k) and it sends my reports to a computer at my office.  The batch file goes like:

...some stuff
sftp2 -B "c:\upload.sftp2"

It then opens upload.sftp2, which contains:

open my_username@my_server
...some stuff
put file1
...some stuff
quit


The problem is when it is trying to "open my_username@my_server".  The error message is:

Opening connection to my_username@my_server
Warning: Failed to authenticate.
Disconnected; no more authentication methods available (No further authentication methods available.).


The problem first started when I upgraded my ssh client at home to a newer version, from 2.4 to 3.2.  I am not sure what server version I am using, but it supports version 2 of the ssh protocol.  How can I find my ssh server version?  The problem does not occur with client version 2.4.

The REALLY strange thing is that if I execute the batch file at a command prompt, line by line, the problem does not occur.  If I were to type:

sftp2
open my_username@my_server

It has no problems.  I would really like to use the newer client version because it has a few new features.  I don't know if my ssh server needs to be updated because I can't find a version.  Thanks for any help you can provide.
barthalamuAsked:
Who is Participating?
 
heskyttbergConnect With a Mentor Commented:
Hi!

In order to find out what version you are using do this on Linux box in a shell:
rpm -q openssh

If it's less then openssh-3.1p1-6, upgrade.

If the commands work if you type them line by line.

Maybe try to add an extra row in between every command like this:
open my_name@my_server

...some stufff

put file1

...some stuff

quit

------------ end -------------

Hope this helps

Regards
/Hans - Erik Skyttberg
0
 
ender7007Commented:
It might be the sshd pam file.  I know earlier versions had authentication problems like this.  Look in your openssh source directory under ~/openssh-3.x/contrib/redhat for a file sshd.pam.  Copy this file to /etc/pam.d/sshd.  You might want to back up the file that is already there just in case.

This is what I had to do under openssh version 2.3.0p1 so I don't know if it is still an issue.

A Cline
0
 
barthalamuAuthor Commented:
heskyttberg:

Thanks.  My version is up to date.

ender7007:

Thanks, but I don't think I am even using pam.  In any case, I don't have a sshd.pam file, nor is there an ssh directory under/etc/pam.d.

0
 
barthalamuAuthor Commented:
Thank you both heskyttberg and ender7007 for you answers, but heskyttberg was first.  I actually found a workaround for the problem that I can live with.

I ended up just "dumbing down" the sftp2.exe part of the ssh client.  I can still use the added features from the other parts of the ssh suite of programs, but sftp2.exe will just have to stay at version 2.4.  Since all the different various parts of the ssh client suite seem to be self contained .exe files, this "band aid" will work.  Thank you for your help.
0
All Courses

From novice to tech pro — start learning today.