You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by lalyos <la...@yahoo.com> on 2009/11/30 14:34:53 UTC

sshexec verbosity

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


Re: sshexec verbosity

Posted by lalyos <la...@yahoo.com>.
Hi,

I just provided the patch for the documentation here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=48317

Kev, if you could please commit it.
cheers,
lajos

> Hi,
>
> On Tue, Dec 1, 2009 at 7:08 AM, Kevin Jackson <fo...@gmail.com>  
> wrote:
>> Hi,
>>
>>> this sounds like a good idea. I think we should check this in. It  
>>> introduces
>>> a change compared with the last release but this sounds like a  
>>> good change.
>>>
>>> Thoughts ?
>
> Committed fix/change in revision 885684
>
> I've tested it with some in house code here and it looks good to me.
> Any problems with this change, please feel free to revert (it's been
> so long since I've committed to the core/trunk compared to sandbox...)


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


Re: sshexec verbosity

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

On Tue, Dec 1, 2009 at 7:08 AM, Kevin Jackson <fo...@gmail.com> wrote:
> Hi,
>
>> this sounds like a good idea. I think we should check this in. It introduces
>> a change compared with the last release but this sounds like a good change.
>>
>> Thoughts ?

Committed fix/change in revision 885684

I've tested it with some in house code here and it looks good to me.
Any problems with this change, please feel free to revert (it's been
so long since I've committed to the core/trunk compared to sandbox...)

Kev

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


Re: sshexec verbosity

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

> this sounds like a good idea. I think we should check this in. It introduces
> a change compared with the last release but this sounds like a good change.
>
> Thoughts ?

As someone who has been grappling with ssh/scp issues over the last
few months (although not in a an Ant context), I couldn't agree more!

Also I was considering committing this change as my first real work on
the trunk in about a year :(

Kev

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


Re: sshexec verbosity

Posted by Antoine Levy Lambert <an...@gmx.de>.
Hi,

this sounds like a good idea. I think we should check this in. It 
introduces a change compared with the last release but this sounds like 
a good change.

Thoughts ?

Antoine

lalyos wrote:
> 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


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