def agent_auth(transport, username):
 agent = paramiko.Agent()
 agent_keys = agent.get_keys()
 if (len(agent_keys) == 0):
  return
 for key in agent_keys:
  print ('Trying ssh-agent key %s' % hexlify(key.get_fingerprint()))
  try:
   transport.auth_publickey(username, key)
   print '... success!'
   return
  except paramiko.SSHException:
   print '... nope.'

def agent_auth ( transport , username ) : agent = paramiko . Agent ( ) agent_keys = agent . get_keys ( ) if ( len ( agent_keys ) == 0 ) : return for key in agent_keys : print ( 'Trying ssh-agent key %s' % hexlify ( key . get_fingerprint ( ) ) ) try : transport . auth_publickey ( username , key ) print '... success!' return except paramiko . SSHException : print '... nope.'
attempt to authenticate to the given transport using any of the private keys available from an ssh agent .