octossh


Nameoctossh JSON
Version 20230711.post2 PyPI version JSON
download
home_page
SummarySSH password log-in and command automator
upload_time2023-07-11 21:49:28
maintainer
docs_urlNone
author
requires_python>=3.0
licenseBSD-3-Clause
keywords ssh bouncer pass
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## octossh - SSH password log-in and command automator

octossh automates SSH password login and command execution through annotations on `ssh_config(5)` Hosts:
* password authentication, reading password from pass[1]:
  * config:  `# ocsh pass <pass-name>`
  * command: `$ ocsh host`
* post-login command execution:
  * config:  `# ocsh post <action> "<cmd>"`
  * command: `$ ocsh host[action]`
* post-login command execution, reading additional password from pass[1]:
  * config:  `# ocsh postpass <action> "<cmd>" <pass-name>`
  * command: `$ ocsh host[action]`

[1] https://www.passwordstore.org/

Compatibility with OpenSSH is kept as much as possible:
* support usual SSH aliases, keys and command-line options
* compatible with rsync, scp and other tools using SSH for transport, see example commands
* autocompletion can be set-up with --ocsh-install-autocompletion

## Usage
```
usage: ocsh.py [-h] [--ocsh-verbose] [--ocsh-pretend] [--ocsh-examples]
               [--ocsh-install-autocompletion]
               [destination] ...

octossh - SSH password log-in and command automator

positional arguments:
  destination           host[action]
  args                  any OpenSSH options or remote command

options:
  -h, --help            show this help message and exit
  --ocsh-verbose        enable debug messages
  --ocsh-pretend        do not actually perform the connection
  --ocsh-examples       show example octossh configuration and commands
  --ocsh-install-autocompletion
                        install bash autocompletion for the current user
```

## Installation

```
pip install octossh
```

## Examples of usage
```
# connect to SSH alias 'host1' with automated password login
# ssh_config(5)
Host host1
   Hostname 10.0.0.1
   User minou
   # ocsh pass pass-location                 # location in password-store
# command
ocsh host1
# equivalent ssh command
sshpass -p "$(pass pass-location)" ssh host1

# connect to SSH alias 'host2' with automated password login, going through the above 'host1', and become root
# ssh_config(5)
Host host2
    Host 10.9.0.1
    User root
    # ocsh pass pass-location2               # location in password-store
    # ocsh postpass su "su -l" pass-location3
    # ocsh post nsep "ip netns exec nsep"    # post-login command to enter a network namespace
# command
ocsh host2[root]
# equivalent ssh command
sshpass -p "$(pass pass-location2)" ssh -oProxyCommand="sshpass -p "$(pass pass-location1)" ssh host1" host2 su -l
<now enter root password (from pass-location3) manually>

# run rsync through octossh from host1 with automated password login
rsync -e "ocsh" -avP host1:/etc/hosts /tmp/

# run scp through octossh from host1 with automated password login
scp -S "ocsh" host1:/etc/hosts /tmp/
```

## See also

* netmiko - python library to SSH to various network devices
  https://github.com/ktbyers/netmiko
* sshpass - automate SSH password-based log-in
  https://github.com/kevinburke/sshpass
* passh - sshpass alternative to automate SSH password-based log-in
  https://github.com/clarkwang/passh

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "octossh",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "",
    "keywords": "ssh,bouncer,pass",
    "author": "",
    "author_email": "Laurent Ghigonis <ooookiwi@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fe/31/307cfacc33a16a2a0ddb18d8bd78f16250ebab6461b92946d7353e1fea82/octossh-20230711.post2.tar.gz",
    "platform": null,
    "description": "## octossh - SSH password log-in and command automator\n\noctossh automates SSH password login and command execution through annotations on `ssh_config(5)` Hosts:\n* password authentication, reading password from pass[1]:\n  * config:  `# ocsh pass <pass-name>`\n  * command: `$ ocsh host`\n* post-login command execution:\n  * config:  `# ocsh post <action> \"<cmd>\"`\n  * command: `$ ocsh host[action]`\n* post-login command execution, reading additional password from pass[1]:\n  * config:  `# ocsh postpass <action> \"<cmd>\" <pass-name>`\n  * command: `$ ocsh host[action]`\n\n[1] https://www.passwordstore.org/\n\nCompatibility with OpenSSH is kept as much as possible:\n* support usual SSH aliases, keys and command-line options\n* compatible with rsync, scp and other tools using SSH for transport, see example commands\n* autocompletion can be set-up with --ocsh-install-autocompletion\n\n## Usage\n```\nusage: ocsh.py [-h] [--ocsh-verbose] [--ocsh-pretend] [--ocsh-examples]\n               [--ocsh-install-autocompletion]\n               [destination] ...\n\noctossh - SSH password log-in and command automator\n\npositional arguments:\n  destination           host[action]\n  args                  any OpenSSH options or remote command\n\noptions:\n  -h, --help            show this help message and exit\n  --ocsh-verbose        enable debug messages\n  --ocsh-pretend        do not actually perform the connection\n  --ocsh-examples       show example octossh configuration and commands\n  --ocsh-install-autocompletion\n                        install bash autocompletion for the current user\n```\n\n## Installation\n\n```\npip install octossh\n```\n\n## Examples of usage\n```\n# connect to SSH alias 'host1' with automated password login\n# ssh_config(5)\nHost host1\n   Hostname 10.0.0.1\n   User minou\n   # ocsh pass pass-location                 # location in password-store\n# command\nocsh host1\n# equivalent ssh command\nsshpass -p \"$(pass pass-location)\" ssh host1\n\n# connect to SSH alias 'host2' with automated password login, going through the above 'host1', and become root\n# ssh_config(5)\nHost host2\n    Host 10.9.0.1\n    User root\n    # ocsh pass pass-location2               # location in password-store\n    # ocsh postpass su \"su -l\" pass-location3\n    # ocsh post nsep \"ip netns exec nsep\"    # post-login command to enter a network namespace\n# command\nocsh host2[root]\n# equivalent ssh command\nsshpass -p \"$(pass pass-location2)\" ssh -oProxyCommand=\"sshpass -p \"$(pass pass-location1)\" ssh host1\" host2 su -l\n<now enter root password (from pass-location3) manually>\n\n# run rsync through octossh from host1 with automated password login\nrsync -e \"ocsh\" -avP host1:/etc/hosts /tmp/\n\n# run scp through octossh from host1 with automated password login\nscp -S \"ocsh\" host1:/etc/hosts /tmp/\n```\n\n## See also\n\n* netmiko - python library to SSH to various network devices\n  https://github.com/ktbyers/netmiko\n* sshpass - automate SSH password-based log-in\n  https://github.com/kevinburke/sshpass\n* passh - sshpass alternative to automate SSH password-based log-in\n  https://github.com/clarkwang/passh\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "SSH password log-in and command automator",
    "version": "20230711.post2",
    "project_urls": {
        "Homepage": "https://github.com/looran/octossh"
    },
    "split_keywords": [
        "ssh",
        "bouncer",
        "pass"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e74a73ed1731823b2b898f4a06eb54e85d277e673f5054b79ed0399be94ff636",
                "md5": "9676551c6e2bbc59768d887268a0e95b",
                "sha256": "42d693ce245c676484975e31cf47c1b10e7d636e47826c6a1fcc66f2431b0344"
            },
            "downloads": -1,
            "filename": "octossh-20230711.post2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9676551c6e2bbc59768d887268a0e95b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 6595,
            "upload_time": "2023-07-11T21:49:26",
            "upload_time_iso_8601": "2023-07-11T21:49:26.914648Z",
            "url": "https://files.pythonhosted.org/packages/e7/4a/73ed1731823b2b898f4a06eb54e85d277e673f5054b79ed0399be94ff636/octossh-20230711.post2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe31307cfacc33a16a2a0ddb18d8bd78f16250ebab6461b92946d7353e1fea82",
                "md5": "752d23936c8a359a0212baeddeb81dd5",
                "sha256": "97b5669fdcd72d63495f63875f46768813d60d8a952b0743f98e11f6fdc08219"
            },
            "downloads": -1,
            "filename": "octossh-20230711.post2.tar.gz",
            "has_sig": false,
            "md5_digest": "752d23936c8a359a0212baeddeb81dd5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 5628,
            "upload_time": "2023-07-11T21:49:28",
            "upload_time_iso_8601": "2023-07-11T21:49:28.185821Z",
            "url": "https://files.pythonhosted.org/packages/fe/31/307cfacc33a16a2a0ddb18d8bd78f16250ebab6461b92946d7353e1fea82/octossh-20230711.post2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-11 21:49:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "looran",
    "github_project": "octossh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "octossh"
}
        
Elapsed time: 0.89972s