Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The host is unknown to the system

 
Gökhan Sakalli
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the HostKeyVerification interface and its implementing classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic