Here is how I do it.
Session session = jsch.getSession(username, address, port);
UserInfo ui = new MyUserInfo();
session.setUserInfo(ui);
session.connect();
HostKey hk=session.getHostKey();
String tf = hk.getFingerPrint( jsch );
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of srikanth
k.m
Sent: Thursday, 11 September 2008 14:18
To: [email protected]
Subject: [JSch-users] StrictHostKeyChecking =true
Hi All,
I am trying to perform Server authentication. I have set
"StrictHostKeyChecking" to yes. I understand that the hostkey of the
server has to be obtained before hand and store in the hostkey file
before the first attempt to connect to the server. How can I get the
HostKey of the server by any external entity?
Is there any format to which the hostkey in the hostkey file must adhere
to? Since I see that the hostkey stored in the hostkeyfile will be in a
hash of the server FingerPrint.
Can anyone please provide some information on this.
Thanks
Srikanth
____________________________________
This e-mail may be privileged and/or confidential, and the sender does not
waive any related rights and obligations. Any distribution, use or copying of
this e-mail or the information it contains by other than an intended
recipient(s) is unauthorized. If you received this e-mail in error, please
advise me (by return e-mail or otherwise) immediately and delete this e-mail.
The contents of any attachment to this e-mail may contain software
viruses or other defect which might affect your own computer system once
received or opened. While companies under RBC Dexia Investor Services Trust and
its affiliates take reasonable precautions to minimize that risk, we cannot
accept liability or responsibility for any damage or loss which may occur or be
sustained as a result of a software virus or other defect. You are responsible
for virus checks before opening any attachment.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users