Home | Trees | Index | Help |
---|
Package paramiko :: Module transport :: Class BaseTransport |
|
object
--+ |_Verbose
--+ |Thread
--+ | BaseTransport
Transport
Method Summary | |
---|---|
Create a new SSH session over an existing socket, or socket-like object. | |
string |
Returns a string representation of this object, for debugging. |
accept(self,
timeout)
| |
Add a host key to the list of keys used for server mode. | |
Channel
|
(subclass override) Determine if a channel request of a given type will be granted, and return a suitable Channel object. |
Close this session, and any open channels that are tied to it. | |
Negotiate an SSH2 session, and optionally verify the server's host key and authenticate using a password or private key. | |
(string, string) |
Return the host key of the server (in client mode). |
PKey
|
Return the active host key, in server mode. |
boolean |
Return true if this session is active (open). |
boolean |
(optional) Load a file of prime moduli for use in doing group-exchange key negotiation in server mode. (Static method) |
Channel
|
Request a new channel to the server. |
Channel
|
Request a new channel to the server, of type "session" . |
boolean |
Force this session to switch to new keys. |
Negotiate a new SSH2 session as a client. | |
Negotiate a new SSH2 session as a server. | |
Inherited from Thread | |
| |
| |
| |
| |
| |
| |
| |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Class Variable Summary | |
---|---|
int |
OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED = 1 |
int |
OPEN_FAILED_CONNECT_FAILED = 2 |
int |
OPEN_FAILED_RESOURCE_SHORTAGE = 4 |
int |
OPEN_FAILED_UNKNOWN_CHANNEL_TYPE = 3 |
list |
preferred_ciphers = ['aes128-cbc', 'blowfish-cbc', 'aes2...
|
list |
preferred_kex = ['diffie-hellman-group1-sha1', 'diffie-h...
|
list |
preferred_keys = ['ssh-rsa', 'ssh-dss']
|
list |
preferred_macs = ['hmac-sha1', 'hmac-md5', 'hmac-sha1-96...
|
int |
REKEY_BYTES = 1073741824 |
int |
REKEY_PACKETS = 1073741824 |
Instance Method Details |
---|
__init__(self,
sock)
|
__repr__(self)
Returns a string representation of this object, for debugging.
|
add_server_key(self, key)Add a host key to the list of keys used for server mode. When behaving as a server, the host key is used to sign certain packets during the SSH2 negotiation, so that the client can trust that we are who we say we are. Because this is used for signing, the key must contain private key info, not just the public half. |
check_channel_request(self, kind, chanid)(subclass override) Determine if a channel request of a given
type will be granted, and return a suitable In server mode, you will generally want to subclass None ,
rejecting any channel requests. A useful server must override this
method.
|
close(self)Close this session, and any open channels that are tied to it. |
connect(self, hostkeytype=None, hostkey=None, username='', password=None, pkey=None)Negotiate an SSH2 session, and optionally verify the server's host
key and authenticate using a password or private key. This is a
shortcut for open_channel or open_session to get a Channel object, which is used for data
transfer.
|
get_remote_server_key(self)Return the host key of the server (in client mode). The type string is usually either"ssh-rsa" or
"ssh-dss" and the key is an opaque string, which
may be saved or used for comparison with previously-seen keys. (In
other words, you don't need to worry about the content of the key, only
that it compares equal to the key you expected to see.)
|
get_server_key(self)Return the active host key, in server mode. After negotiating with the client, this method will return the negotiated host key. If only one type of host key was set withadd_server_key , that's the only key that
will ever be returned. But in cases where you have set more than one
type of host key (for example, an RSA key and a DSS key), the key type
will be negotiated by the client, and this method will return the key
of the type agreed on. If the host key has not been negotiated yet,
None is returned. In client mode, the behavior is
undefined.
|
is_active(self)Return true if this session is active (open).
|
open_channel(self, kind)Request a new channel to the server.Channel s are socket-like objects used for
the actual transfer of data across the session. You may only request a
channel after negotiating encryption (using connect or start_client and authenticating.
|
open_session(self)Request a new channel to the server, of type"session" . This is just an alias for
open_channel('session') .
|
renegotiate_keys(self)Force this session to switch to new keys. Normally this is done automatically after the session hits a certain number of packets or bytes sent or received, but this method gives you the option of forcing new keys whenever you want. Negotiating new keys causes a pause in traffic both ways as the two sides swap keys and do computations. This method returns when the session has switched to new keys, or the session has died mid-negotiation.
|
start_client(self, event=None)Negotiate a new SSH2 session as a client. This is the first step
after creating a new When negotiation is done (successful or not), the given
auth_password or auth_publickey .
|
start_server(self, event=None)Negotiate a new SSH2 session as a server. This is the first step
after creating a new When negotiation is done (successful or not), the given
After a successful negotiation, the client will need to
authenticate. Override the methods check_channel_request to allow channels
to be opened.
|
Static Method Details |
---|
load_server_moduli(filename=None)(optional) Load a file of prime moduli for use in doing group-exchange key negotiation in server mode. It's a rather obscure option and can be safely ignored. In server mode, the remote client may request "group-exchange" key negotiation, which asks the server to send a random prime number that fits certain criteria. These primes are pretty difficult to compute, so they can't be generated on demand. But many systems contain a file of suitable primes (usually named something like/etc/ssh/moduli ). If you call
load_server_moduli and it returns True , then
this file of primes has been loaded and we will support
"group-exchange" in server mode. Otherwise server mode will
just claim that it doesn't support that method of key negotiation.
|
Class Variable Details |
---|
OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
OPEN_FAILED_CONNECT_FAILED
|
OPEN_FAILED_RESOURCE_SHORTAGE
|
OPEN_FAILED_UNKNOWN_CHANNEL_TYPE
|
preferred_ciphers
|
preferred_kex
|
preferred_keys
|
preferred_macs
|
REKEY_BYTES
|
REKEY_PACKETS
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sun Jan 4 02:33:11 2004 | http://epydoc.sf.net |