aspose file tools*
The moose likes Java in General and the fly likes The host is unknown to the system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "The host is unknown to the system" Watch "The host is unknown to the system" New topic
Author

The host is unknown to the system

Gökhan Sakalli
Greenhorn

Joined: Apr 04, 2009
Posts: 20
Hello. I try to connect to a host by using

com.sshtools.j2ssh

When i connect ssh.connect(hostname,portname)

i see in system.out log these messages;

The host key fingerprint is: 1024: XX XX XX XX XX XX XX XX XX X XX XX XX XX XX XX

Do you want to allow this host key? [Yes|No|Always]:

com.sshtools.j2ssh.transport.TransportProtocolClient verifyHostKey The host key was not accepted

I want to accept this key but i am not able to. Is there a method for accepting this key?

I searched for known_hosts file and adding this host key can fix my problem.

How do i add this key?

What is the format for adding the key manually?

must the line be like this?



hostname 1024: XX XX XX XX XX XX XX XX XX X XX XX XX XX XX XX

Thanks
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
I'm not sure if it applyes here, but you can imprt root certificates with keys in you JRE keystore or specify which keystore you're program will use. Try exploring keystores


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

Check out the HostKeyVerification interface and its implementing classes.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
wood burning stoves
 
subject: The host is unknown to the system