pyscripter / Ssh-Pascal

Delphi ssh library wrapping libssh2
MIT License
79 stars 33 forks source link

The authencity of host can't be established #12

Closed soinalastudio closed 8 months ago

soinalastudio commented 1 year ago

Hello, I trying to use your library and while connecting, I got this error: "The authencity of host ... can't be established. I tried using many programs like RemotedDB in android or HeidiSQL + Putty, there is no problem. Can you help me please? Thank you for you libraries! Regards

pyscripter commented 8 months ago

The host IP needs to be added to the known_hosts file.

See TSshSession.CheckKnownHost and TSshSession.ConfigKnownHostCheckPolicy

The default known_hosts file location is initialized as:

  FKnownHostCheckSettings.KnownHostsFile := ExpandEnvStrings(
    IncludeTrailingPathDelimiter('%USERPROFILE%') + '.ssh\known_hosts');

You, probably, have not provided a keyboard callback using SetKeybInteractiveCallback. Otherwise you would have been prompted to accept the host as known.