ant - SCP / SSHEXEC - number of connection attempts -


i using scp task followed sshexec in ant build.xml. derive value password password field on screen. user doesnt have ability check if right password or not until task completes successfully.

as result, if entered password incorrect, scp / sshexec retry connect? there handle limit number of connection retries?

the sshexec , scp tasks use java secure channel jsch, see ant manual library dependencies.
had similiar problem, jsch tries authenticate 6 times configured in com.jcraft.jsch.jsch class. when wrong password used, user account got locked.
patched com.jcraft.jsch.jsch class :

from :

config.put("maxauthtries", "6"); 

to :

config.put("maxauthtries", "3"); 

means jsch try 3 times authenticate.

-- edit after comment --

  1. download jsch release zip here - latest version 0.1.51

  2. unzip

  3. open jsch-0.1.51/src/main/java/com/jcraft/jsch/jsch.java

  4. change line 124
    from
    config.put("maxauthtries", "6");
    to
    config.put("maxauthtries", "3");

  5. save

  6. run jsch-0.1.51/build.bat or build.sh according os

  7. use jsch-0.1.51/dist/lib/jsch-0.1.5.jar


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -