KpyM Telnet/SSH Server - Forum
|known_hosts and server public key
||known_hosts and server public key
||Oct 06 2009 18:57
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
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 ?
||Oct 08 2009 10:13
> 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.
© 2007 - 2008 Kroum Grigorov