{ "info": { "author": "NetAngels team", "author_email": "info@netangels.ru", "bugtrack_url": null, "classifiers": [], "description": "OpenSSH Python wrapper\n=======================\n\nUnder some circumstances simple wrapper around OpenSSH ``ssh`` command-line\nutility seems more preferable than paramiko machinery.\n\nThis project proposes yet another hopefully thin wrapper around ``ssh`` to\nexecute commands on remote servers. All you need thereis to make sure that\nOpenSSH client and Python interpreter are installed, and then install\n`openssh-wrapper` package.\n\nUsage sample\n-------------\n\nSimple command execution ::\n\n >>> from openssh_wrapper import SSHConnection\n >>> conn = SSHConnection('localhost', login='root')\n >>> ret = conn.run('whoami')\n >>> print ret\n command: whoami\n stdout: root\n stderr: \n returncode: 0\n >>> ret.command\n 'whoami'\n >>> ret.stdout\n 'root'\n >>> ret.stderr\n ''\n >>> ret.returncode\n 0\n\nIf python interpreter is installed on a remote machine, you can also run pieces\nof python code remotely. The same is true for any other interpreter which can\nexecute code from stdin ::\n\n >>> ret = conn.run('whoami')\n >>> print conn.run('print \"Hello world\"', interpreter='/usr/bin/python').stdout\n Hello world\n\nYet another userful `run` method option is `forward_ssh_agent` (the feature\nwhich paramiko doesn't yet have). Suppose you have access as support to foobar\nserver while root@localhost does not, so you can take advantage of SSH agent\nforwarding ::\n\n $ eval `ssh-agent`\n Agent pid 5272\n $ ssh-add \n Identity added: /home/me/.ssh/id_rsa (/home/,e/.ssh/id_rsa)\n $ python\n >>> conn = SSHConnection('localhost', login='root')\n >>> print conn.run('ssh support@foobar \"whoami\"', forward_ssh_agent=True).stdout\n support\n\n\nThere is a sample which shows how to copy a file from local to\nremote machine. You can also define owner and mode of the target ::\n\n >>> fd = open('test.txt', 'w')\n >>> fd.write('Hello world')\n >>> fd.close()\n >>> from openssh_wrapper import SSHConnection\n >>> conn = SSHConnection('localhost', login='root')\n >>> conn.scp(('test.txt', ), target='/tmp', mode='0666', owner='nobody:')\n >>> print conn.run('cat /tmp/test.txt').stdout\n Hello world\n >>> print conn.run('ls -l /tmp/test.txt').stdout\n -rw-rw-rw- 1 nobody nogroup ... /tmp/test.txt\n\n\nYou can also pass file-like objects instead of filenames to scp method. Behind\nthe scenes the method creates temporary files for you, send them to remote\ntarget and then removes everything which has been created::\n\n >>> from StringIO import StringIO\n >>> data = StringIO('test')\n >>> from openssh_wrapper import SSHConnection\n >>> conn = SSHConnection('localhost', login='root')\n >>> conn.scp((data, ), target='/tmp/test.txt', mode='0644')\n >>> print open('/tmp/test.txt').read()\n test", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NetAngels/openssh-wrapper", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "openssh-wrapper", "package_url": "https://pypi.org/project/openssh-wrapper/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/openssh-wrapper/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/NetAngels/openssh-wrapper" }, "release_url": "https://pypi.org/project/openssh-wrapper/0.4/", "requires_dist": null, "requires_python": null, "summary": "OpenSSH python wrapper", "version": "0.4" }, "last_serial": 1790187, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "2148d5dba5e49b86059fde35138eee94", "sha256": "e10672c480eb2d2d5e899ea6895f5c5d39ad3417247a794548fc4e232bfa6e2a" }, "downloads": -1, "filename": "openssh-wrapper-0.2.tar.gz", "has_sig": false, "md5_digest": "2148d5dba5e49b86059fde35138eee94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3602, "upload_time": "2011-06-21T14:01:29", "url": "https://files.pythonhosted.org/packages/dd/45/9fdba70a2779e3a21a473d2d61a667ba186f64aeaf703c44ad01d4d14606/openssh-wrapper-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "382bfe3ed920754d088e610c2230257c", "sha256": "e772193e6ce30008e1b204ae217b4ab5864a15f22dfcd1afebacb816850b6857" }, "downloads": -1, "filename": "openssh-wrapper-0.2.1.tar.gz", "has_sig": false, "md5_digest": "382bfe3ed920754d088e610c2230257c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4075, "upload_time": "2012-03-23T11:00:34", "url": "https://files.pythonhosted.org/packages/1b/b8/0e2a73eba6a579f0a55ab6c8ad3d4a1d0fb9f1d308686514c98af4034653/openssh-wrapper-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "d36a620f3125730d46f636dc462586c2", "sha256": "d7533a70918861f2a2a5ad2eb0a2e9319d6dbe26ee34dc90a4fbb9aefb542c6e" }, "downloads": -1, "filename": "openssh-wrapper-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d36a620f3125730d46f636dc462586c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4082, "upload_time": "2012-03-27T10:16:25", "url": "https://files.pythonhosted.org/packages/87/90/089239d399e8d9e139640f1b86424888226f76b902c84647d67896373fe5/openssh-wrapper-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d55cdd610adf8dbfc8ea7fcaaf9b6757", "sha256": "3feee35e580ce9a49cb46df046686c73562e8782d60b13d273263e9be3108fd4" }, "downloads": -1, "filename": "openssh-wrapper-0.3.tar.gz", "has_sig": false, "md5_digest": "d55cdd610adf8dbfc8ea7fcaaf9b6757", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5098, "upload_time": "2012-04-26T05:17:59", "url": "https://files.pythonhosted.org/packages/e7/df/37703f59c6c22e52eb7119619a201f216fa32cb81b5af84a38e6c6bd52e8/openssh-wrapper-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7a4340b4298dee0af152740b2abae3d6", "sha256": "2207f1713678aee1bd9e2f46df61bd4c584f793962847b98b62be369e859ad9f" }, "downloads": -1, "filename": "openssh-wrapper-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7a4340b4298dee0af152740b2abae3d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5101, "upload_time": "2012-04-27T13:24:02", "url": "https://files.pythonhosted.org/packages/e4/3f/009f90b514583b649853407297d1eb683395f20b9e4ba6dfb15dd7b554ea/openssh-wrapper-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "8f2921cb9043e34e2454cd6e29dcecda", "sha256": "6d619872a26fbf541eeab72c3eb20dca7289343f22ff74656d7fa41d28ee378c" }, "downloads": -1, "filename": "openssh-wrapper-0.3.2.tar.gz", "has_sig": false, "md5_digest": "8f2921cb9043e34e2454cd6e29dcecda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5100, "upload_time": "2012-05-18T11:57:25", "url": "https://files.pythonhosted.org/packages/ea/3a/9cce005fecb7e8288082a9adeb983135be110cbf9697c724c8a9493d9fc4/openssh-wrapper-0.3.2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "1e797313a6a89e3f3f03303198e0b5b4", "sha256": "93e5533b4961cf44f9ab53253fd130e5b7bf7fc324c2a527d5df1eb8ab7618f3" }, "downloads": -1, "filename": "openssh-wrapper-0.4.tar.gz", "has_sig": false, "md5_digest": "1e797313a6a89e3f3f03303198e0b5b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7188, "upload_time": "2013-01-24T16:04:14", "url": "https://files.pythonhosted.org/packages/29/6a/defe79acbecd6ae9fb112faa4925237f647874127d142bb3218fc64c406d/openssh-wrapper-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1e797313a6a89e3f3f03303198e0b5b4", "sha256": "93e5533b4961cf44f9ab53253fd130e5b7bf7fc324c2a527d5df1eb8ab7618f3" }, "downloads": -1, "filename": "openssh-wrapper-0.4.tar.gz", "has_sig": false, "md5_digest": "1e797313a6a89e3f3f03303198e0b5b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7188, "upload_time": "2013-01-24T16:04:14", "url": "https://files.pythonhosted.org/packages/29/6a/defe79acbecd6ae9fb112faa4925237f647874127d142bb3218fc64c406d/openssh-wrapper-0.4.tar.gz" } ] }