On 11/26/2009 06:19 AM, Prasad Shindikar wrote:
> Hello JSch Users,
>
> I want the SSH library to connect (create input / output streams) to the
> remote machine and prompt me for a password.
>
> This is because, in the production environment, there are a lot of
> security checks that kick in and hence I need to provide encrypted
> password, or something similar to a public key to login successfully to
> the machine.
>
> However, since I cannot know that before hand, if I am able to read
> "Password:" from the stream; I will provide a password else I will
> provide the encrypted data.

I think you would be better off building a two tier connection:  first 
you attempt to connect using a PKI approach.  Should that fail (your 
code should be catching this failure via an exception of some sort such 
that you know the key didn't do the trick).  Knowing this, you would 
invoke a GUI or command line I/O interaction with the User to provide a 
password and then try again using a password based approach.

It pains me to see JSch APIs that blur business side logic and User 
interaction.  This is just plain bad design, especially in the face of a 
broad library that has no need for such blurring.

> Hope I am being clear here.

We'll know shortly. :-)  Hope my answer helps.

-pmr

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to