Avatar of barthalamu
barthalamu
 asked on

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.
Linux DistributionsInstallationLinux

Avatar of undefined
Last Comment
barthalamu

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
heskyttberg

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ender7007

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
barthalamu

ASKER
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.

barthalamu

ASKER
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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy