Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


SSH question on Red Hat 7.2

Posted on 2003-02-26
Medium Priority
Last Modified: 2013-12-06
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

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:

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.
Question by:barthalamu
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

heskyttberg earned 1800 total points
ID: 8033042

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


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

Hope this helps

/Hans - Erik Skyttberg

Expert Comment

ID: 8039781
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

Author Comment

ID: 8040454

Thanks.  My version is up to date.


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.


Author Comment

ID: 8040510
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.

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question