Package paramiko :: Module client :: Class MissingHostKeyPolicy
[frames] | no frames]

Class MissingHostKeyPolicy

source code

object --+
         |
        MissingHostKeyPolicy
Known Subclasses:

Interface for defining the policy that `.SSHClient` should use when the SSH server's hostname is not in either the system host keys or the application's keys. Pre-made classes implement policies for automatically adding the key to the application's `.HostKeys` object (`.AutoAddPolicy`), and for automatically rejecting the key (`.RejectPolicy`).

This function may be used to ask the user to verify the key, for example.

Instance Methods
 
missing_host_key(self, client, hostname, key)
Called when an `.SSHClient` receives a server key for a server that isn't in either the system or local `.HostKeys` object.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

missing_host_key(self, client, hostname, key)

source code 

Called when an `.SSHClient` receives a server key for a server that isn't in either the system or local `.HostKeys` object. To accept the key, simply return. To reject, raised an exception (which will be passed to the calling application).