Package x2go :: Module checkhosts :: Class X2goInteractiveAddPolicy
[frames] | no frames]

Class X2goInteractiveAddPolicy

source code

                   object --+    
                            |    
paramiko.MissingHostKeyPolicy --+
                                |
                               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
 
__init__(self, caller=None, session_instance=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
missing_host_key(self, client, hostname, key)
Handle a missing host key situation.
source code
X2goControlSession* instance
get_client(self)
Retrieve the Paramiko SSH/Client.
source code
str
get_hostname(self)
Retrieve the server hostname:port expression of the server to be validated.
source code
str
get_hostname_name(self)
Retrieve the server hostname string of the server to be validated.
source code
str
get_hostname_port(self)
Retrieve the server port of the server to be validated.
source code
Paramiko/SSH key instance
get_key(self)
Retrieve the host key of the server to be validated.
source code
str
get_key_name(self)
Retrieve the host key name of the server to be validated.
source code
str
get_key_fingerprint(self)
Retrieve the host key fingerprint of the server to be validated.
source code
str
get_key_fingerprint_with_colons(self)
Retrieve the (colonized) host key fingerprint of the server to be validated.
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, caller=None, session_instance=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • caller (class) - calling instance
  • session_instance (X2goSession instance) - an X2Go session instance
Overrides: object.__init__

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

get_client(self)

source code 

Retrieve the Paramiko SSH/Client.

Returns: X2goControlSession* instance
the associated X2Go control session instance.

get_hostname(self)

source code 

Retrieve the server hostname:port expression of the server to be validated.

Returns: str
hostname:port

get_hostname_name(self)

source code 

Retrieve the server hostname string of the server to be validated.

Returns: str
hostname

get_hostname_port(self)

source code 

Retrieve the server port of the server to be validated.

Returns: str
port

get_key(self)

source code 

Retrieve the host key of the server to be validated.

Returns: Paramiko/SSH key instance
host key

get_key_name(self)

source code 

Retrieve the host key name of the server to be validated.

Returns: str
host key name (RSA, DSA, ...)

get_key_fingerprint(self)

source code 

Retrieve the host key fingerprint of the server to be validated.

Returns: str
host key fingerprint

get_key_fingerprint_with_colons(self)

source code 

Retrieve the (colonized) host key fingerprint of the server to be validated.

Returns: str
host key fingerprint (with colons)