Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`conch`.`endpoints`.`_UserAuth``

class documentation

`class _UserAuth(SSHUserAuthClient): (source)`

View In Hierarchy

`_UserAuth` implements the client part of SSH user authentication in the convenient way a user might expect if they are familiar with the interactive ssh command line client.

`_UserAuth` supports key-based authentication, password-based authentication, and delegating authentication to an agent.

Method | `connectToAgent` | Set up a connection to the authentication agent and trigger its initialization.
Method | `getPassword` | Get the password to use for authentication.
Method | `getPrivateKey` | Get the private part of a key pair to use for authentication. The key corresponds to the public part most recently returned from `getPublicKey`.
Method | `getPublicKey` | Retrieve the next public key object to offer to the server, possibly delegating to an authentication agent if there is one.
Method | `loseAgentConnection` | Disconnect the agent.
Method | `signData` | Extend the base signing behavior by using an SSH agent to sign the data, if one is available.
Method | `ssh_USERAUTH_SUCCESS` | Handle user authentication success in the normal way, but also make a note of the state change on the `_CommandTransport`.
Class Variable | `agent` | Undocumented
Class Variable | `keys` | Undocumented
Class Variable | `password` | Undocumented
Instance Variable | `key` | Undocumented

Inherited from `SSHUserAuthClient`:

Method | `__init__` | Undocumented
Method | `askForAuth` | Send a MSG_USERAUTH_REQUEST.
Method | `auth_keyboard_interactive` | Try to authenticate with keyboard-interactive authentication. Send the request to the server and return True.
Method | `auth_password` | Try to authenticate with a password. Ask the user for a password. If the user will return a password, return True. Otherwise, return False.
Method | `auth_publickey` | Try to authenticate with a public key. Ask the user for a public key; if the user has one, send the request to the server and return True. Otherwise, return False.
Method | `getGenericAnswers` | Returns a `Deferred` with the responses to the promopts.
Method | `serviceStarted` | called when the service is active on the transport.
Method | `ssh_USERAUTH_FAILURE` | We received a MSG_USERAUTH_FAILURE. Payload:
Method | `ssh_USERAUTH_PK_OK` | This message (number 60) can mean several different messages depending on the current authentication type. We dispatch to individual methods in order to handle this request.
Method | `ssh_USERAUTH_PK_OK_keyboard_interactive` | This is MSG_USERAUTH_INFO_RESPONSE. The server has sent us the questions it wants us to answer, so we ask the user and sent the responses.
Method | `ssh_USERAUTH_PK_OK_password` | This is MSG_USERAUTH_PASSWD_CHANGEREQ. The password given has expired. We ask for an old password and a new password, then send both back to the server.
Method | `ssh_USERAUTH_PK_OK_publickey` | This is MSG_USERAUTH_PK. Our public key is valid, so we create a signature and try to authenticate with it.
Method | `tryAuth` | Dispatch to an authentication method.
Instance Variable | `authenticatedWith` | a list of strings of authentication methods we've tried
Instance Variable | `instance` | the service to start after authentication has finished
Instance Variable | `lastAuth` | Undocumented
Instance Variable | `lastPublicKey` | the last public key object we've tried to authenticate with
Instance Variable | `name` | the name of this service: 'ssh-userauth'
Instance Variable | `preferredOrder` | a list of authentication methods that should be used first, in order of preference, if supported by the server
Instance Variable | `triedPublicKeys` | a list of public key objects that we've tried to authenticate with
Instance Variable | `user` | the name of the user to authenticate as
Method | `_cbGenericAnswers` | Called back when we are finished answering keyboard-interactive questions. Send the info back to the server in a MSG_USERAUTH_INFO_RESPONSE.
Method | `_cbGetPublicKey` | Undocumented
Method | `_cbPassword` | Called back when the user gives a password. Send the request to the server.
Method | `_cbSignData` | Called back when the private key is returned. Sign the data and return the signature.
Method | `_cbSignedData` | Called back out of self.signData with the signed data. Send the authentication request with the signature.
Method | `_cbUserauthFailure` | Undocumented
Method | `_ebAuth` | Generic callback for a failed authentication attempt. Respond by asking for the list of accepted methods (the 'none' method)
Method | `_setNewPass` | Called back when we are choosing a new password. Get the old password and send the authentication message with both.
Method | `_setOldPass` | Called back when we are choosing a new password. Simply store the old password for now.
Instance Variable | `_newPass` | Undocumented
Instance Variable | `_oldPass` | Undocumented

Inherited from `SSHService` (via `SSHUserAuthClient`):

Method | `logPrefix` | Undocumented
Method | `packetReceived` | called when we receive a packet on the transport
Method | `serviceStopped` | called when the service is stopped, either by the connection ending or by another service being started
Class Variable | `protocolMessages` | Undocumented
Class Variable | `transport` | Undocumented
Class Variable | `_log` | Undocumented

def connectToAgent(self, endpoint): (source)

Set up a connection to the authentication agent and trigger its initialization.

Parameters
endpoint:`IStreamClientEndpoint` provider | An endpoint which can be used to connect to the authentication agent.
Returns
A `Deferred` which fires when the agent connection is ready for use.

def getPassword(self): (source)
overrides `twisted.conch.ssh.userauth.SSHUserAuthClient.getPassword`

Get the password to use for authentication.

Returns
A `Deferred` which fires with the password, or `None` if the password was not specified.

def getPrivateKey(self): (source)
overrides `twisted.conch.ssh.userauth.SSHUserAuthClient.getPrivateKey`

Get the private part of a key pair to use for authentication. The key corresponds to the public part most recently returned from `getPublicKey`.

Returns
`Deferred` | A `Deferred` which fires with the private key.

def getPublicKey(self): (source)
overrides `twisted.conch.ssh.userauth.SSHUserAuthClient.getPublicKey`

Retrieve the next public key object to offer to the server, possibly delegating to an authentication agent if there is one.

Returns
`twisted.conch.ssh.keys.Key` or `None` | The public part of a key pair that could be used to authenticate with the server, or `None` if there are no more public keys to try.

def loseAgentConnection(self): (source)

Disconnect the agent.

def signData(self, publicKey, signData): (source)
overrides `twisted.conch.ssh.userauth.SSHUserAuthClient.signData`

Extend the base signing behavior by using an SSH agent to sign the data, if one is available.

Parameters
publicKey:`Key` | Undocumented
signData:`str` | Undocumented

def ssh_USERAUTH_SUCCESS(self, packet): (source)
overrides `twisted.conch.ssh.userauth.SSHUserAuthClient.ssh_USERAUTH_SUCCESS`

Handle user authentication success in the normal way, but also make a note of the state change on the `_CommandTransport`.

agent = (source)

Undocumented

keys = (source)

Undocumented

password = (source)

Undocumented

key = (source)

Undocumented