Why does sftp in batchmode not prompt for a password in RHEL5 or later version?

Solution Verified - Updated -

Issue

  • If run the following commands, it shows Permission Denied error:
$ sftp -b ftpput.cmd <user@site>  

$ cat ftpput.cmd  
lls -l <filename>  
ls -l  
put <sourcefile> <targetfile>  
ls -l  
bye
  • I want to get password in batch mode as it did work in RHEL4 rather than showing below error
Permission denied (publickey,password,keyboard-interactive).
Couldn't read packet: Connection reset by peer

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content