ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lalyos <>
Subject sshexec verbosity
Date Mon, 30 Nov 2009 13:34:53 GMT

I run into some trouble with sshexec, and tried to turn verbosity on: - 
debug and -verbose ant option didn't change anything.
The only way to get some details was changing the source code,  
recompile it, and use the hacked ant-jsch.jar and jsch.jar.

By examining the source i realized that there is already a verbose  
property on but its used only in

I would suggest that sshexec may interpret the verbose attribute by  
changing the default logger for its JSch delegate object:

in the openSession() method of after the creation of the  
delegate "JSch jsch = new JSch();"

final SSHBase mySSHBase = this;
if (verbose) {
     jsch.setLogger(new com.jcraft.jsch.Logger(){
         public boolean isEnabled(int level){return true;}
         public void log(int level, String message) 
{mySSHBase.log(message, Project.MSG_INFO);}

adding these line would change the output from the original:

 > ant -f build_ssh.xml
Buildfile: build_ssh.xml

   [sshexec] Connecting to
   ... no details to see

to the more helpful:

ant -f build_ssh.xml
Buildfile: build_ssh.xml

   [sshexec] Connecting to
   [sshexec] Connecting to port 2223
   [sshexec] Connection established
   [sshexec] Remote version string: SSH-1.99-OpenSSH_5.1
   [sshexec] Local version string: SSH-2.0-JSCH-0.1.42
   [sshexec] CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256- 
   [sshexec] SSH_MSG_KEXINIT sent
   [sshexec] SSH_MSG_KEXINIT received
   [sshexec] kex: server->client aes128-ctr hmac-md5 none
   [sshexec] kex: client->server aes128-ctr hmac-md5 none
   [sshexec] SSH_MSG_KEXDH_INIT sent
   [sshexec] expecting SSH_MSG_KEXDH_REPLY
   [sshexec] ssh_rsa_verify: signature true
   [sshexec] Permanently added '' (RSA) to the list of  
known hosts.
   [sshexec] SSH_MSG_NEWKEYS sent
   [sshexec] SSH_MSG_NEWKEYS received
   [sshexec] SSH_MSG_SERVICE_REQUEST sent
   [sshexec] SSH_MSG_SERVICE_ACCEPT received
   [sshexec] Authentications that can continue: gssapi-with- 
   [sshexec] Next authentication method: gssapi-with-mic
   [sshexec] Authentications that can continue: publickey,keyboard- 
   [sshexec] Next authentication method: publickey
   [sshexec] Authentications that can continue: keyboard- 
   [sshexec] Next authentication method: keyboard-interactive


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message