code: def _get_ssh_client(self, host, user, key):
          
  
          ssh = paramiko.SSHClient()
          ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  
          pkey = None
  
          # Read the private key into a paramiko.RSAKey
          if os.path.exists(key):
              with open(key, 'r') as f:
                  pkey = paramiko.RSAKey.from_private_key(f)
  
          #######################################################################
          # There is a bug in some versions of OpenSSH 4.3 (CentOS/RHEL5) where #
          # the server may not send the SSH_MSG_USERAUTH_BANNER message except  #
          # when responding to an auth_none request. For example, paramiko will #
          # attempt to use password authentication when a password is set, but  #
          # the server could deny that, instead requesting keyboard-interactive.#
          # The hack to workaround this is to attempt a reconnect, which will   #
          # receive the right banner, and authentication can proceed. See the   #
          # following for more info:                                            #
          # https://github.com/paramiko/paramiko/issues/432                     #
          # https://github.com/paramiko/paramiko/pull/438                       #
          #######################################################################
  
          try:
              ssh.connect(host, port=22, username=user, pkey=pkey)
          except paramiko.ssh_exception.SSHException as e:
              if 'Error reading SSH protocol banner' == str(e):
                  # Once more, with feeling
                  ssh.connect(host, port=22, username=user, pkey=pkey)
              else:
                  # Reraise the original exception
                  raise e
  
          return ssh
docs: Return a connected Paramiko ssh object.
  
          :param str host: The host to connect to.
          :param str user: The user to connect as.
          :param str key: The private key to authenticate with.
  
          :return: object: A paramiko.SSHClient
          :raises: :class:`paramiko.ssh_exception.SSHException` if the
              connection failed