Pragma Systems Technical Forum

sftp utility - number of password attempts

https://forums.pragmasys.com/Topic210.aspx

By mrrex4 - 9/24/2013 5:42:45 PM

Hi,

I am developing a Java application that is designed to upload files via the sftp.exe utility.  In an effort to account for all possible outcomes, I believe I am running into an issue with the sftp utility providing the ability to try and re-enter a password an additional two times.

From the perspective of sftp, I am running the command with all necessary options to pass the username, password, server, and default directory on the first attempt.  When I run this from the command prompt with an incorrect password, I get prompted to enter a password.  I believe this is where my Java program is hanging because it is waiting for sftp to close on it's own.

Therefore, is it possible for the sftp utility to simply return to the standard error stream "Incorrect username/password" with no ability to re-type a password if using the -A option?

I would imagine that this could be a very simple update to the utility.

Otherwise, I would love to just have a Java API for working directly with the sftp utility.  ;)

v/r,

Brendan
By bethredd - 9/25/2013 5:17:56 AM

Hello Brendan,

You can alter the number of password attempts using the option numberofpasswordprompts.

This can be passed as an option to the sftp client with:
sftp -onumberofpasswordprompts=1 user@host

or it can be entered in the .config file of the ssh client, which should be located in the PragmaSSH subdirectory of the users %APPDATA% directory.

Please check our online documentation at www.pragmasys.com/Fortress/WebHelp under the topic What comes with Fortress SSH Server > Remote Access Clients > Console SSH Client > SSH Configuration File.

We have had multiple request for a Java API, so it is a possible future feature.

Beth Redd 
Customer Support Manager 
13809 Research Blvd, #675 
Austin, TX 78750 
http://www.pragmasys.com
 
Follow us on    

By mrrex4 - 9/25/2013 6:55:53 AM

Beth,

That is awesome.  I will give that a try.

Also, I took a look at the link provided and thank you for that as well.  There are a few other options in there that I was going to look for, but no longer need to.

Thanks!

Brendan