Package x2go :: Module checkhosts :: Class X2GoInteractiveAddPolicy

[frames] | no frames]

# Class X2GoInteractiveAddPolicy

source code

                       object --+
                                |
    paramiko.MissingHostKeyPolicy --+
                                    |
             X2GoMissingHostKeyPolicy --+
                                        |
                                       X2GoInteractiveAddPolicy

Policy for making host key information available to Python X2Go after a Paramiko/SSH connect has been attempted. This class needs information about the associated X2GoSession instance.

Once called, the missing_host_key method of this class will try to call X2GoSession.HOOK_check_host_dialog(). This hook method---if not re-defined in your application---will then try to call the X2GoClient.HOOK_check_host_dialog(), which then will return `True` by default if not customized in your application.

To accept host key checks, make sure to either customize the X2GoClient.HOOK_check_host_dialog() method or the X2GoSession.HOOK_check_host_dialog() method and hook some interactive user dialog to either of them.

Instance Methods

missing_host_key(self, client, hostname, key) Handle a missing host key situation. | source code

Inherited from `X2GoMissingHostKeyPolicy`: `__init__`, `get_client`, `get_hostname`, `get_hostname_name`, `get_hostname_port`, `get_key`, `get_key_fingerprint`, `get_key_fingerprint_with_colons`, `get_key_name`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__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

Handle a missing host key situation. This method calls

Once called, the missing_host_key method will try to call X2GoSession.HOOK_check_host_dialog(). This hook method---if not re-defined in your application---will then try to call the X2GoClient.HOOK_check_host_dialog(), which then will return `True` by default if not customized in your application.

To accept host key checks, make sure to either customize the X2GoClient.HOOK_check_host_dialog() method or the X2GoSession.HOOK_check_host_dialog() method and hook some interactive user dialog to either of them.

Parameters:
  - `client` (`X2GoControlSession*` instance) - SSH client (`X2GoControlSession*`) instance
  - `hostname` (`str`) - remote hostname
  - `key` (Paramiko/SSH key instance) - host key to validate
Raises:
  - `X2GoHostKeyException` - if the X2Go server host key is not in the `known_hosts` file
  - `X2GoSSHProxyHostKeyException` - if the SSH proxy host key is not in the `known_hosts` file
  - `SSHException` - if this instance does not know its {self.session_instance}
Overrides: paramiko.MissingHostKeyPolicy.missing_host_key