Popular recipes tagged "ssh"http://code.activestate.com/recipes/tags/ssh/popular/2015-12-06T14:19:15-08:00ActiveState Code RecipesMonkey-patch execnet with more ssh settings, port, identity file, non-interactive (Python) 2011-01-15T16:35:00-08:00Dima Tisnekhttp://code.activestate.com/recipes/users/4068698/http://code.activestate.com/recipes/577545-monkey-patch-execnet-with-more-ssh-settings-port-i/ <p style="color: grey"> Python recipe 577545 by <a href="/recipes/users/4068698/">Dima Tisnek</a> (<a href="/recipes/tags/batchmode/">batchmode</a>, <a href="/recipes/tags/execnet/">execnet</a>, <a href="/recipes/tags/identity/">identity</a>, <a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/noninteractive/">noninteractive</a>, <a href="/recipes/tags/port/">port</a>, <a href="/recipes/tags/public/">public</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/ssh/">ssh</a>). </p> <p>execnet ( <a href="http://codespeak.net/execnet/" rel="nofollow">http://codespeak.net/execnet/</a> ) is pretty cool, but its ssh support needs a few tweaks, here they are.</p> <p>This snipped is a monkey patch, not a diff, import it and you can use execnet.makeportgateway instead of makegateway.</p> <p>Adapt to your needs even more!</p> Copy files over SSH using paramiko (Python) 2015-12-06T14:19:15-08:00ccpizzahttp://code.activestate.com/recipes/users/4170754/http://code.activestate.com/recipes/576810-copy-files-over-ssh-using-paramiko/ <p style="color: grey"> Python recipe 576810 by <a href="/recipes/users/4170754/">ccpizza</a> (<a href="/recipes/tags/paramiko/">paramiko</a>, <a href="/recipes/tags/scp/">scp</a>, <a href="/recipes/tags/ssh/">ssh</a>). Revision 20. </p> <p>This script copies files in unattended mode over SSH using a glob pattern. It uses the <a href="http://www.lag.net/paramiko/">paramiko</a> module behind the scenes. It operates as an actual SSH client, and does <em>not</em> rely on any command line utilities, such as <code>scp</code>.</p> <p>It first tries to connect using a key from a private key file or from an SSH agent. If RSA authentication fails, it will try to authenticate with a password if passwords are allowed on the SSH server. Assumes the <code>rsa_private_key</code> was generated with an empty passphrase.</p> <p>On most linux/unix-like systems paramiko can be installed with <code>sudo easy_install paramiko</code> or <code>pip install paramiko</code> or using the built-in system package manager.</p> <p>See also <a href="http://www.paramiko.org/installing.html" rel="nofollow">http://www.paramiko.org/installing.html</a></p> Automated management of CLI devices (Python) 2009-05-27T01:24:12-07:00Alan Holthttp://code.activestate.com/recipes/users/4170480/http://code.activestate.com/recipes/576778-automated-management-of-cli-devices/ <p style="color: grey"> Python recipe 576778 by <a href="/recipes/users/4170480/">Alan Holt</a> (<a href="/recipes/tags/cli/">cli</a>, <a href="/recipes/tags/management/">management</a>, <a href="/recipes/tags/ssh/">ssh</a>, <a href="/recipes/tags/telnet/">telnet</a>, <a href="/recipes/tags/tunnel/">tunnel</a>). </p> <p>This recipe provides a mechanism for remote, automated control of a network device via its command-line interface (CLI). It assumes that the CLI is accessed using Telnet. Furthermore, the device cannot be accessed directly, instead the user has to SSH to an intermediate jump host before Telneting to the device. </p>