Module ImportFrom alias alias alias alias alias alias ImportFrom alias alias alias ImportFrom alias Import alias alias alias alias Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Num Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam defaults body Print BinOpMod Str NameLoad If CompareEq NameLoad NameLoad body Return Call AttributeLoad NameLoad attr NameLoad orelse Print BinOpMod Str NameLoad Return Call AttributeLoad NameLoad attr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Print NameLoad Print NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body If NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If BoolOpOr UnaryOpNot NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr body Return Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpPow Num Num BinOpPow Num Num NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpPow Num Num BinOpPow Num Num NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpPow Num Num BinOpPow Num Num NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Print Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str NameLoad Index Num Print BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Print Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str NameLoad Index Num Print BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Print Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Call AttributeLoad NameLoad attr Str keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Print BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list decorator_list Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr
N/A twisted.conch.ssh transport userauth connection common keys channel twisted.internet defer protocol reactor twisted.python log N/A struct sys getpass os N/A 
Example of using a simple SSH client.

It will try to authenticate with a SSH key or ask for a password.

Re-using a private key is dangerous, generate one.
For this example you can use:

$ ckeygen -t rsa -f ssh-keys/client_rsa
 N/A USER user N/A HOST localhost N/A PORT 5022 N/A SERVER_FINGERPRINT pu:t:se:rv:er:fi:ng:er:pr:in:t:he:re N/A CLIENT_RSA_PUBLIC ssh-keys/client_rsa.pub N/A CLIENT_RSA_PRIVATE ssh-keys/client_rsa SimpleTransport N/A N/A transport SSHClientTransport N/A verifyHostKey N/A N/A self hostKey fingerprint N/A N/A N/A N/A Server host key fingerprint: %s fingerprint N/A N/A SERVER_FINGERPRINT fingerprint N/A N/A N/A N/A defer succeed True N/A N/A N/A Bad host key. Expecting: %s SERVER_FINGERPRINT N/A N/A N/A defer fail N/A Exception Bad server key N/A connectionSecure N/A N/A self N/A N/A N/A N/A N/A self requestService N/A SimpleUserAuth USER N/A SimpleConnection N/A N/A SimpleUserAuth N/A N/A userauth SSHUserAuthClient N/A getPassword N/A N/A self N/A N/A N/A N/A N/A defer succeed N/A N/A getpass getpass N/A %s@%s's password:  N/A USER HOST N/A getGenericAnswers N/A N/A self name instruction questions N/A N/A N/A name N/A instruction N/A answers N/A N/A N/A prompt echo questions N/A N/A echo N/A N/A answer N/A raw_input prompt N/A N/A answer N/A N/A getpass getpass prompt N/A N/A N/A answers append answer N/A N/A N/A defer succeed answers N/A getPublicKey N/A N/A self N/A N/A N/A N/A N/A CLIENT_RSA_PUBLIC N/A N/A N/A N/A os path exists CLIENT_RSA_PUBLIC N/A self lastPublicKey N/A N/A N/A N/A N/A N/A keys Key fromFile filename CLIENT_RSA_PUBLIC N/A getPrivateKey N/A N/A self N/A N/A N/A 
        A deferred can also be returned.
         N/A N/A N/A defer succeed N/A N/A N/A keys Key fromFile CLIENT_RSA_PRIVATE N/A N/A SimpleConnection N/A N/A connection SSHConnection N/A serviceStarted N/A N/A self N/A N/A N/A N/A N/A self openChannel N/A TrueChannel N/A 2 16 N/A 2 15 self N/A N/A N/A self openChannel N/A FalseChannel N/A 2 16 N/A 2 15 self N/A N/A N/A self openChannel N/A CatChannel N/A 2 16 N/A 2 15 self N/A N/A TrueChannel N/A N/A channel SSHChannel N/A N/A name session openFailed N/A N/A self reason N/A N/A N/A true failed reason N/A channelOpen N/A N/A self ignoredData N/A N/A N/A N/A N/A N/A self conn sendRequest self exec N/A N/A common NS true N/A request_exit_status N/A N/A self data N/A N/A N/A status N/A N/A N/A struct unpack >L data N/A 0 N/A N/A true status was: %s status N/A N/A N/A self loseConnection N/A N/A FalseChannel N/A N/A channel SSHChannel N/A N/A name session openFailed N/A N/A self reason N/A N/A N/A false failed reason N/A channelOpen N/A N/A self ignoredData N/A N/A N/A N/A N/A N/A self conn sendRequest self exec N/A N/A common NS false N/A request_exit_status N/A N/A self data N/A N/A N/A status N/A N/A N/A struct unpack >L data N/A 0 N/A N/A false status was: %s status N/A N/A N/A self loseConnection N/A N/A CatChannel N/A N/A channel SSHChannel N/A N/A name session openFailed N/A N/A self reason N/A N/A N/A echo failed reason N/A channelOpen N/A N/A self ignoredData N/A N/A N/A N/A self data N/A d N/A N/A N/A self conn sendRequest self exec N/A N/A common NS cat wantReply 1 N/A N/A N/A d addCallback N/A self _cbRequest N/A _cbRequest N/A N/A self ignored N/A N/A N/A N/A N/A self write hello conch
 N/A N/A N/A N/A self conn sendEOF self N/A dataReceived N/A N/A self data N/A N/A N/A N/A self data data N/A closed N/A N/A self N/A N/A N/A N/A got data from cat: %s N/A repr N/A self data N/A N/A N/A self loseConnection N/A N/A N/A reactor stop N/A N/A N/A N/A N/A log startLogging N/A sys stdout N/A N/A N/A N/A N/A protocol ClientCreator reactor SimpleTransport connectTCP HOST PORT N/A N/A N/A reactor run