• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

The host is unknown to the system

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22895
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the HostKeyVerification interface and its implementing classes.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic