-
-
Notifications
You must be signed in to change notification settings - Fork 4
SSH.Session.CheckHost
Andrew Lambert edited this page Nov 26, 2022
·
6 revisions
Function CheckHost(Hosts As SSH.KnownHosts, AddHost As Boolean) As Boolean
Name | Type | Comment |
---|---|---|
Hosts |
KnownHosts | The list of known hosts to check. |
AddHost |
Boolean | If True, the session will be added to the list. |
Returns True if the host+key were found (or added). Check Session.LastError if it returns False.
Compares the current session to a list of known hostkeys.
This table lists the various return value/LastError combinations for different values of the AddHost
parameter:
AddHost |
Session.LastError |
Return value | Comment |
---|---|---|---|
True or False | 0 |
True | The hostkey was found and matches the remote host. |
True or False | ERR_HOSTKEY_MISMATCH |
False | The hostkey was found but does not match the remote host! |
False | ERR_HOSTKEY_NOTFOUND |
False | The hostkey was not found. |
True | ERR_HOSTKEY_NOTFOUND |
True | The hostkey was successfully added. |
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2018-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.