Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
boto
/
manage
/
File Content:
cmdshell.pyo
� �Wc @ s� d Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d � Z d d d d � Z d S( s The cmdshell module uses the paramiko package to create SSH connections to the servers that are represented by instance objects. The module has functions for running commands, managing files, and opening interactive shell sessions over those connections. i����( t interactive_shellN( t StringIOt SSHClientc B s� e Z d Z d d d d d � Z d d � Z d � Z d � Z d � Z d d d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( se This class creates a paramiko.SSHClient() object that represents a session with an SSH server. You can use the SSHClient object to send commands to the remote host and manipulate files on the remote host. :ivar server: A Server object or FakeServer object. :ivar host_key_file: The path to the user's .ssh key files. :ivar uname: The username for the SSH connection. Default = 'root'. :ivar timeout: The optional timeout variable for the TCP connection. :ivar ssh_pwd: An optional password to use for authentication or for unlocking the private key. s ~/.ssh/known_hostst rootc C s� | | _ | | _ | | _ | | _ t j j | j d | �| _ t j � | _ | j j � | j j t j j | � � | j j t j � � | j � d S( Nt password( t servert host_key_filet unamet _timeoutt paramikot RSAKeyt from_private_key_filet ssh_key_filet _pkeyR t _ssh_clientt load_system_host_keyst load_host_keyst ost patht expandusert set_missing_host_key_policyt AutoAddPolicyt connect( t selfR R R t timeoutt ssh_pwd( ( s8 /usr/lib/python2.7/site-packages/boto/manage/cmdshell.pyt __init__3 s i c C s d } x| | k ry9 | j j | j j d | j d | j d | j �d SWq t j k r� } | j \ } } | d k r� d GHt j d � | d 7} q� q t j k r� d | j j GHd GHt d � | d 7} q t k r d GHt j d � | d 7} q Xq Wd GHd S( s� Connect to an SSH server and authenticate with it. :type num_retries: int :param num_retries: The maximum number of connection attempts. i t usernamet pkeyR Ni3 i= io s/ SSH Connection refused, will retry in 5 secondsi i s: %s has an entry in ~/.ssh/known_hosts and it doesn't matchsC Edit that file to remove the entry and then hit return to try agains Hit Enter when readys8 Unexpected Error from SSH Connection, retry in 5 secondss"