Host keys structures (those manipulated by load_system_host_keys A host key is known when it appears in the client object’s cached.Subclass of MissingHostKeyPolicy such as RejectPolicy (theĭefault), AutoAddPolicy, WarningPolicy, or a user-created A policy is a “policy class” (or instance thereof), namely some.Set policy to use when connecting to servers without a known host key. Name ( str) – new channel name for logging The default is "ansport"īut it can be set to anything you want. The local host keys as a HostKeys object. IOError – if the file could not be written Parameters:įilename ( str) – the filename to save to Host keys loaded with load_system_host_keys. Load_host_keys (plus any added directly) will be saved – not any IOError – if the filename could not be read When automatically saving, the last hostname is used. Saves them, when connecting to a previously-unknown server.Ĭonflicts). The missing host key policy AutoAddPolicy adds keys to this set and Method will be checked after keys loaded via load_system_host_keys,īut will be saved back by save_host_keys (so they can be modified). Load host keys from a local host-key file.
If a filename was provided and the file could not be read
Parameters:įilename ( str) – the filename to read, or None Keys from the user’s local “known hosts” file, as used by OpenSSH,Īnd no exception will be raised if the file can’t be read. If filename is left as None, an attempt will be made to read Will be merged with the existing set (new replacing old if there are This method can be called multiple times. This method will not be saved back by save_host_keys. Load host keys from a system (read-only) file. load_system_host_keys ( filename=None ) ¶