Package Products :: Package DataCollector :: Module SshClient :: Class SshUserAuth |
[hide private]
[frames] | no frames]

# Class SshUserAuth

source code

               twisted.python.log.Logger --+
                                           |
        twisted.conch.ssh.service.SSHService --+
                                               |
    twisted.conch.ssh.userauth.SSHUserAuthClient --+
                                                   |
                                                  SshUserAuth

Class to gather credentials for use with our SSH connection, and use them to authenticate against the remote device.

Instance Methods | [hide private]
__init__(self, user, instance, factory) If no username is supplied, defaults to the user running this code (eg zenoss) | source code
Twisted deferred object |
getPassword(self, unused=None) Called from conch. | source code
getGenericAnswers(self, name, instruction, prompts) Called from conch. | source code
_getPassword(self) Get the password. | source code
_handleFailure(self, message) Handle a failure by logging a message, sending an event, calling clientFinished, and returning a failure defered. | source code
_getKey(self) | source code
string |
getPublicKey(self) Return the SSH public key (using the zProperty zKeyPath) or None | source code
Twisted deferred object |
getPrivateKey(self) Return a deferred with the SSH private key (using the zProperty zKeyPath) | source code
`defer.Deferred` or `None` |
ssh_USERAUTH_FAILURE(self, packet) Called when the SSH session can't authenticate. | source code
Inherited from `twisted.conch.ssh.userauth.SSHUserAuthClient`: `askForAuth`, `auth_keyboard_interactive`, `auth_password`, `auth_publickey`, `serviceStarted`, `signData`, `ssh_USERAUTH_PK_OK`, `ssh_USERAUTH_PK_OK_keyboard_interactive`, `ssh_USERAUTH_PK_OK_password`, `ssh_USERAUTH_PK_OK_publickey`, `ssh_USERAUTH_SUCCESS`, `tryAuth` Inherited from `twisted.conch.ssh.userauth.SSHUserAuthClient` (private): `_cbGenericAnswers`, `_cbGetPublicKey`, `_cbPassword`, `_cbSignData`, `_cbSignedData`, `_cbUserauthFailure`, `_ebAuth`, `_setNewPass`, `_setOldPass` Inherited from `twisted.conch.ssh.service.SSHService`: `logPrefix`, `packetReceived`, `serviceStopped`

Class Variables | [hide private]
Inherited from `twisted.conch.ssh.userauth.SSHUserAuthClient`: `protocolMessages` Inherited from `twisted.conch.ssh.service.SSHService`: `transport`

Instance Variables | [hide private]
Inherited from `twisted.conch.ssh.userauth.SSHUserAuthClient`: `authenticatedWith`, `instance`, `lastPublicKey`, `name`, `preferredOrder`, `triedPublicKeys`, `user`

Method Details | [hide private]

### __init__(self, user, instance, factory) (Constructor) | source code
If no username is supplied, defaults to the user running this code (eg zenoss) Parameters: `user` (string) - username `instance` (object) - instance object `factory` (Twisted factory object) - factory info Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.__init__

### getPassword(self, unused=None) | source code
Called from conch. Return a deferred object of success if there's a password or return fail (ie no zCommandPassword specified) Parameters: `unused` (string) - unused (unused) Returns: Twisted deferred object Twisted deferred object (defer.succeed or defer.fail) Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.getPassword

### getGenericAnswers(self, name, instruction, prompts) | source code
Called from conch. Returns a `Deferred` with the responses to the prompts. Parameters: `name` - The name of the authentication currently in progress. `instruction` - Describes what the authentication wants. `prompts` - A list of (prompt, echo) pairs, where prompt is a string to display and echo is a boolean indicating whether the user's response should be echoed as they type it. Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.getGenericAnswers

### _getPassword(self) | source code
Get the password. Raise an exception if it is not set.

### getPublicKey(self) | source code
Return the SSH public key (using the zProperty zKeyPath) or None Returns: string SSH public key Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.getPublicKey

### getPrivateKey(self) | source code
Return a deferred with the SSH private key (using the zProperty zKeyPath) Returns: Twisted deferred object Twisted deferred object (defer.succeed) Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.getPrivateKey

### ssh_USERAUTH_FAILURE(self, packet) | source code
    Called when the SSH session can't authenticate.
    NB: This function is also called as an initializer
        to start the connections.

    @param packet: returned packet from the host
    @type packet: object
Parameters: `packet` - the `MSG_USERAUTH_FAILURE` payload. Returns: `defer.Deferred` or `None` a `defer.Deferred` that will be callbacked with `None` as soon as all authentication methods have been tried, or `None` if no more authentication methods are available. Overrides: twisted.conch.ssh.userauth.SSHUserAuthClient.ssh_USERAUTH_FAILURE