KpyM Telnet/SSH Server - Forum
known_hosts and server public key
peter known_hosts and server public key
 
Hello

I am running on windows (client and KTS server).
To connect to KTS (SFTP) using jsch.jar (Java library) and StrictHostKeyChecking yes settings, I need to provide known_hosts file to client application.

known_hosts file should looks like this:

hostname.domain.com,192.168.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAABI
wAAAIEA1XY18+zA8VNK2YkzygOkMqUxHSTfxT1Xxx8CgDZgcQH8HUhPssW5tt
vG8nKetlPQZAVk1C4WkWS1y5b3ekBhZTIxocp9Joc6V1+f2EOfO2mSLRwB16R
Grdw6q7msrBXTC/dl+hF45kMMzVNzqxnSMVOa0sEPK2zK6Sg3Vi9fCSM=

But where to get server public key in that form.
KTS contains this file: rsakey.ky (... is it public key ???)

rsakey.ky is in binary form.

Is it able to convert it into form needed by known_hosts file ?

Thanks

P.


Kroum Grigorov
 
> KTS contains this file: rsakey.ky (... is it public key ???)
No this is the server private key, the publick key is exchanged with the client upon connect(this is part of the SSH protocol).

> I need to provide known_hosts file to client
The easiest I can think of is to get an ssh.exe - this is the openssh client (l0c41://sshwindows.sourceforge.net/) and to connect it to KTS. This will generate the file C:\Documents and Settings\<user name>\.ssh\known_hosts that hopefully you would be able to use in your Java app.
On theory you should be able to extgract the publick key from your Java library directly after you connect it to the server.

Kroum


 

© 2007 - 2008 Kroum Grigorov
Powered by phpBB © 2001, 2005 phpBB Group