HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //usr/share/doc/python27-paramiko-1.15.1/docs/api/agent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>SSH agents &mdash; Paramiko  documentation</title>
    
    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Paramiko  documentation" href="../index.html" />
    <link rel="next" title="Host keys / known_hosts files" href="hostkeys.html" />
    <link rel="prev" title="Transport" href="transport.html" />
   
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="hostkeys.html" title="Host keys / known_hosts files"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="transport.html" title="Transport"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Paramiko  documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-paramiko.agent">
<span id="ssh-agents"></span><h1>SSH agents<a class="headerlink" href="#module-paramiko.agent" title="Permalink to this headline">¶</a></h1>
<p>SSH Agent interface</p>
<dl class="class">
<dt id="paramiko.agent.Agent">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">Agent</tt><a class="headerlink" href="#paramiko.agent.Agent" title="Permalink to this definition">¶</a></dt>
<dd><p>Client interface for using private keys from an SSH agent running on the
local machine.  If an SSH agent is running, this class can be used to
connect to it and retreive <a class="reference internal" href="keys.html#paramiko.pkey.PKey" title="paramiko.pkey.PKey"><tt class="xref py py-obj docutils literal"><span class="pre">PKey</span></tt></a> objects which can be used when
attempting to authenticate to remote SSH servers.</p>
<p>Upon initialization, a session with the local machine&#8217;s SSH agent is
opened, if one is running. If no agent is running, initialization will
succeed, but <a class="reference internal" href="#paramiko.agent.Agent.get_keys" title="paramiko.agent.Agent.get_keys"><tt class="xref py py-obj docutils literal"><span class="pre">get_keys</span></tt></a> will return an empty tuple.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name" colspan="2">Raises SSHException:</th></tr>
<tr class="field-odd field"><td>&nbsp;</td><td class="field-body">if an SSH agent is found, but speaks an incompatible protocol</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="paramiko.agent.Agent.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.Agent.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close the SSH agent connection.</p>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.Agent.get_keys">
<tt class="descname">get_keys</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.Agent.get_keys" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of keys available through the SSH agent, if any.  If
no SSH agent was running (or it couldn&#8217;t be contacted), an empty list
will be returned.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a tuple of <a class="reference internal" href="#paramiko.agent.AgentKey" title="paramiko.agent.AgentKey"><tt class="xref py py-obj docutils literal"><span class="pre">AgentKey</span></tt></a> objects representing keys available on the
SSH agent</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentClientProxy">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentClientProxy</tt><big>(</big><em>chanRemote</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentClientProxy" title="Permalink to this definition">¶</a></dt>
<dd><p>Class proxying request as a client:</p>
<ol class="arabic simple">
<li>client ask for a request_forward_agent()</li>
<li>server creates a proxy and a fake SSH Agent</li>
<li>server ask for establishing a connection when needed,
calling the forward_agent_handler at client side.</li>
<li>the forward_agent_handler launch a thread for connecting
the remote fake agent and the local agent</li>
<li>Communication occurs ...</li>
</ol>
<dl class="method">
<dt id="paramiko.agent.AgentClientProxy.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentClientProxy.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close the current connection and terminate the agent
Should be called manually</p>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentClientProxy.connect">
<tt class="descname">connect</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentClientProxy.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Method automatically called by <tt class="docutils literal"><span class="pre">AgentProxyThread.run</span></tt>.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentKey">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentKey</tt><big>(</big><em>agent</em>, <em>blob</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Private key held in a local SSH agent.  This type of key can be used for
authenticating to a remote server (signing).  Most other key operations
work as expected.</p>
<dl class="method">
<dt id="paramiko.agent.AgentKey.can_sign">
<tt class="descname">can_sign</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.can_sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <tt class="docutils literal"><span class="pre">True</span></tt> if this key has the private part necessary for signing
data.</p>
</dd></dl>

<dl class="classmethod">
<dt id="paramiko.agent.AgentKey.from_private_key">
<em class="property">classmethod </em><tt class="descname">from_private_key</tt><big>(</big><em>file_obj</em>, <em>password=None</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.from_private_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a key object by reading a private key from a file (or file-like)
object.  If the private key is encrypted and <tt class="docutils literal"><span class="pre">password</span></tt> is not <tt class="docutils literal"><span class="pre">None</span></tt>,
the given password will be used to decrypt the key (otherwise
<a class="reference internal" href="ssh_exception.html#paramiko.ssh_exception.PasswordRequiredException" title="paramiko.ssh_exception.PasswordRequiredException"><tt class="xref py py-obj docutils literal"><span class="pre">PasswordRequiredException</span></tt></a> is thrown).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>file_obj</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#file" title="(in Python v2.6)"><em>file</em></a>) &#8211; the file to read from</li>
<li><strong>password</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; an optional password to use to decrypt the key, if it&#8217;s encrypted</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a new <a class="reference internal" href="keys.html#paramiko.pkey.PKey" title="paramiko.pkey.PKey"><tt class="xref py py-obj docutils literal"><span class="pre">PKey</span></tt></a> based on the given private key</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li><strong>IOError</strong> &#8211; if there was an error reading the key</li>
<li><strong>PasswordRequiredException</strong> &#8211; if the private key file is encrypted,
and <tt class="docutils literal"><span class="pre">password</span></tt> is <tt class="docutils literal"><span class="pre">None</span></tt></li>
<li><strong>SSHException</strong> &#8211; if the key file is invalid</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="classmethod">
<dt id="paramiko.agent.AgentKey.from_private_key_file">
<em class="property">classmethod </em><tt class="descname">from_private_key_file</tt><big>(</big><em>filename</em>, <em>password=None</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.from_private_key_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a key object by reading a private key file.  If the private
key is encrypted and <tt class="docutils literal"><span class="pre">password</span></tt> is not <tt class="docutils literal"><span class="pre">None</span></tt>, the given password
will be used to decrypt the key (otherwise <a class="reference internal" href="ssh_exception.html#paramiko.ssh_exception.PasswordRequiredException" title="paramiko.ssh_exception.PasswordRequiredException"><tt class="xref py py-obj docutils literal"><span class="pre">PasswordRequiredException</span></tt></a>
is thrown).  Through the magic of Python, this factory method will
exist in all subclasses of PKey (such as <a class="reference internal" href="keys.html#paramiko.rsakey.RSAKey" title="paramiko.rsakey.RSAKey"><tt class="xref py py-obj docutils literal"><span class="pre">RSAKey</span></tt></a> or <a class="reference internal" href="keys.html#paramiko.dsskey.DSSKey" title="paramiko.dsskey.DSSKey"><tt class="xref py py-obj docutils literal"><span class="pre">DSSKey</span></tt></a>), but
is useless on the abstract PKey class.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>filename</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; name of the file to read</li>
<li><strong>password</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; an optional password to use to decrypt the key file,
if it&#8217;s encrypted</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a new <a class="reference internal" href="keys.html#paramiko.pkey.PKey" title="paramiko.pkey.PKey"><tt class="xref py py-obj docutils literal"><span class="pre">PKey</span></tt></a> based on the given private key</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li><strong>IOError</strong> &#8211; if there was an error reading the file</li>
<li><strong>PasswordRequiredException</strong> &#8211; if the private key file is
encrypted, and <tt class="docutils literal"><span class="pre">password</span></tt> is <tt class="docutils literal"><span class="pre">None</span></tt></li>
<li><strong>SSHException</strong> &#8211; if the key file is invalid</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.get_base64">
<tt class="descname">get_base64</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.get_base64" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a base64 string containing the public part of this key.  Nothing
secret is revealed.  This format is compatible with that used to store
public key files or recognized host keys.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a base64 <a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><tt class="xref py py-obj docutils literal"><span class="pre">string</span></tt></a> containing the public part of the key.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.get_bits">
<tt class="descname">get_bits</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.get_bits" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of significant bits in this key.  This is useful
for judging the relative security of a key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">bits in the key (as an <a class="reference external" href="http://docs.python.org/2.6/library/functions.html#int" title="(in Python v2.6)"><tt class="xref py py-obj docutils literal"><span class="pre">int</span></tt></a>)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.get_fingerprint">
<tt class="descname">get_fingerprint</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.get_fingerprint" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an MD5 fingerprint of the public part of this key.  Nothing
secret is revealed.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a 16-byte <a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><tt class="xref py py-obj docutils literal"><span class="pre">string</span></tt></a> (binary) of the MD5 fingerprint, in SSH
format.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.verify_ssh_sig">
<tt class="descname">verify_ssh_sig</tt><big>(</big><em>data</em>, <em>msg</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.verify_ssh_sig" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a blob of data, and an SSH message representing a signature of
that data, verify that it was signed with this key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; the data that was signed.</li>
<li><strong>msg</strong> (<em>.Message</em>) &#8211; an SSH signature message</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">True</span></tt> if the signature verifies correctly; <tt class="docutils literal"><span class="pre">False</span></tt> otherwise.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.write_private_key">
<tt class="descname">write_private_key</tt><big>(</big><em>file_obj</em>, <em>password=None</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.write_private_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Write private key contents into a file (or file-like) object.  If the
password is not <tt class="docutils literal"><span class="pre">None</span></tt>, the key is encrypted before writing.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>file_obj</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#file" title="(in Python v2.6)"><em>file</em></a>) &#8211; the file object to write into</li>
<li><strong>password</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; an optional password to use to encrypt the key</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li><strong>IOError</strong> &#8211; if there was an error writing to the file</li>
<li><strong>SSHException</strong> &#8211; if the key is invalid</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentKey.write_private_key_file">
<tt class="descname">write_private_key_file</tt><big>(</big><em>filename</em>, <em>password=None</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentKey.write_private_key_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Write private key contents into a file.  If the password is not
<tt class="docutils literal"><span class="pre">None</span></tt>, the key is encrypted before writing.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>filename</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; name of the file to write</li>
<li><strong>password</strong> (<a class="reference external" href="http://docs.python.org/2.6/library/functions.html#str" title="(in Python v2.6)"><em>str</em></a>) &#8211; an optional password to use to encrypt the key file</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li><strong>IOError</strong> &#8211; if there was an error writing the file</li>
<li><strong>SSHException</strong> &#8211; if the key is invalid</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentLocalProxy">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentLocalProxy</tt><big>(</big><em>agent</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentLocalProxy" title="Permalink to this definition">¶</a></dt>
<dd><p>Class to be used when wanting to ask a local SSH Agent being
asked from a remote fake agent (so use a unix socket for ex.)</p>
<dl class="method">
<dt id="paramiko.agent.AgentLocalProxy.get_connection">
<tt class="descname">get_connection</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentLocalProxy.get_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a pair of socket object and string address.</p>
<p>May block!</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentProxyThread">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentProxyThread</tt><big>(</big><em>agent</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentProxyThread" title="Permalink to this definition">¶</a></dt>
<dd><p>Class in charge of communication between two channels.</p>
</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentRemoteProxy">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentRemoteProxy</tt><big>(</big><em>agent</em>, <em>chan</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentRemoteProxy" title="Permalink to this definition">¶</a></dt>
<dd><p>Class to be used when wanting to ask a remote SSH Agent</p>
</dd></dl>

<dl class="class">
<dt id="paramiko.agent.AgentServerProxy">
<em class="property">class </em><tt class="descclassname">paramiko.agent.</tt><tt class="descname">AgentServerProxy</tt><big>(</big><em>t</em><big>)</big><a class="headerlink" href="#paramiko.agent.AgentServerProxy" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>t</strong> (<em>.Transport</em>) &#8211; Transport used for SSH Agent communication forwarding</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Raises SSHException:</th></tr>
<tr class="field-even field"><td>&nbsp;</td><td class="field-body">mostly if we lost the agent</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="paramiko.agent.AgentServerProxy.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentServerProxy.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Terminate the agent, clean the files, close connections
Should be called manually</p>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentServerProxy.get_env">
<tt class="descname">get_env</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentServerProxy.get_env" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper for the environnement under unix</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a dict containing the <tt class="docutils literal"><span class="pre">SSH_AUTH_SOCK</span></tt> environnement variables</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="paramiko.agent.AgentServerProxy.get_keys">
<tt class="descname">get_keys</tt><big>(</big><big>)</big><a class="headerlink" href="#paramiko.agent.AgentServerProxy.get_keys" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of keys available through the SSH agent, if any.  If
no SSH agent was running (or it couldn&#8217;t be contacted), an empty list
will be returned.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a tuple of <a class="reference internal" href="#paramiko.agent.AgentKey" title="paramiko.agent.AgentKey"><tt class="xref py py-obj docutils literal"><span class="pre">AgentKey</span></tt></a> objects representing keys available on the
SSH agent</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../index.html">Paramiko</a></h1>



<p class="blurb">A Python implementation of SSHv2.</p>



<p>
<iframe src="http://ghbtns.com/github-btn.html?user=paramiko&repo=paramiko&type=watch&count=true&size=large"
  allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>




    

<p>
<a href="https://travis-ci.org/paramiko/paramiko">
    <img
        alt="https://secure.travis-ci.org/paramiko/paramiko.png?branch=master"
        src="https://secure.travis-ci.org/paramiko/paramiko.png?branch=master"
    >
</a>
</p>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="channel.html">Channel</a></li>
<li class="toctree-l1"><a class="reference internal" href="client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="message.html">Message</a></li>
<li class="toctree-l1"><a class="reference internal" href="packet.html">Packetizer</a></li>
<li class="toctree-l1"><a class="reference internal" href="transport.html">Transport</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="">SSH agents</a></li>
<li class="toctree-l1"><a class="reference internal" href="hostkeys.html">Host keys / <tt class="docutils literal"><span class="pre">known_hosts</span></tt> files</a></li>
<li class="toctree-l1"><a class="reference internal" href="keys.html">Key handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="ssh_gss.html">GSS-API authentication</a></li>
<li class="toctree-l1"><a class="reference internal" href="kex_gss.html">GSS-API key exchange</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="proxy.html"><tt class="docutils literal"><span class="pre">ProxyCommand</span></tt> support</a></li>
<li class="toctree-l1"><a class="reference internal" href="server.html">Server implementation</a></li>
<li class="toctree-l1"><a class="reference internal" href="sftp.html">SFTP</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="buffered_pipe.html">Buffered pipes</a></li>
<li class="toctree-l1"><a class="reference internal" href="file.html">Buffered files</a></li>
<li class="toctree-l1"><a class="reference internal" href="pipe.html">Cross-platform pipe implementations</a></li>
<li class="toctree-l1"><a class="reference internal" href="ssh_exception.html">Exceptions</a></li>
</ul>


<hr />
<ul>
    
    <li class="toctree-l1"><a href="http://www.paramiko.org">Main website</a></li>
    
</ul>

<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
<h3>Donate</h3>
<p>
Consider supporting the authors on <a href="https://www.gratipay.com/">Gratipay</a>:
<script data-gratipay-username="bitprophet"
        data-gratipay-widget="button"
        src="//gttp.co/v1.js"></script>
</p>

        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2014 Jeff Forcier.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.2.2</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.6.1</a>
      
      |
      <a href="../_sources/api/agent.txt"
          rel="nofollow">Page source</a></li>
    </div>

    

    
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-18486793-2']);
      _gaq.push(['_setDomainName', 'none']);
      _gaq.push(['_setAllowLinker', true]);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    </script>
    
  </body>
</html>