Load host keys from a system (read-only) file. Host keys read with this method will not be saved back by save_host_keys.
This method can be called multiple times. Each new set of host keys will be merged with the existing set (new replacing old if there are conflicts).
If filename is left as None, an attempt will be made to read keys from the user’s local “known hosts” file, as used by OpenSSH, and no exception will be raised if the file can’t be read. This is probably only useful on posix.
Parameters: | filename (str) – the filename to read, or None |
---|---|
Raises IOError: | if a filename was provided and the file could not be read |