ant-dev mailing list archives

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

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 SSHBase.java but its used only in
Scp.java

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 SSHBase.java 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_test:
   [sshexec] Connecting to myhost.no-ip.org:2223
   ... no details to see

to the more helpful:

ant -f build_ssh.xml
Buildfile: build_ssh.xml

sshexec_test:
   [sshexec] Connecting to myhost.no-ip.org:2223
   [sshexec] Connecting to myhost.no-ip.org 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- 
cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
   [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 'myhost.no-ip.org' (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- 
mic,publickey,keyboard-interactive,password
   [sshexec] Next authentication method: gssapi-with-mic
   [sshexec] Authentications that can continue: publickey,keyboard- 
interactive,password
   [sshexec] Next authentication method: publickey
   [sshexec] Authentications that can continue: keyboard- 
interactive,password
   [sshexec] Next authentication method: keyboard-interactive

cheers,
lajos

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message