SSH and Python

Python is well known for its abundance of libraries which handle just about anything. Recently I needed a Python script to perform commands over SSH. As it turns out there are several convenient ways to perform this.

Paramiko is a python library specifically designed for ssh. It is part of easy_install and pipy can easily be installed:

Paramiko allows a script to pass in multiple commands over SSH:

There are of course other libraries. Python has a library, sh, which allows wrapping of any bash command. This commands invokes a bash process and pass any command whic hcan be quite handy in order to quickly get some information or perform some useful task:

Comments are closed.

Search

Websites

  • slide
  • slide
  • slide
  • slide