Skip to main content

a package on top of fabric to use SSH easily

Project description

topssh

a package on top of fabric to use ssh easily

installation

pip install topssh

usage

from topssh.ssh_lite import SSH
from topssh.ssh import SSH as FullSSH

host = "127.0.0.1"
user ="username"
password = "password"

# lite ssh only captures command output
ssh = SSH(host, user, password)
ssh.add_sudo_watcher()
ssh.connect(timeout=5)

out = ssh.run("hostname")
print(out)

out = ssh.run("uname -a")
print(out)

# all outpus in ssh.echo_text
print("".join(ssh.echo_text))

# full ssh cpatures all output including command input and output
ssh = FullSSH(host, user, password)
ssh.connect(timeout=5)

# add timestamps to output and ignore color chars
# ssh.patch_output()

out = ssh.run("hostname")
print(out)

out = ssh.run("uname -a")
print(out)

# all outpus in ssh.echo_text
print("".join(ssh.echo_text))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topssh-2024.9.27.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

topssh-2024.9.27-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file topssh-2024.9.27.tar.gz.

File metadata

  • Download URL: topssh-2024.9.27.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for topssh-2024.9.27.tar.gz
Algorithm Hash digest
SHA256 708c6b28c633a999de8b8093a1adbda015473c7fe012075f85932abbc7d2fd87
MD5 5a61f1a6cacaea37f8a3ff6c23452511
BLAKE2b-256 8348089604ac7dd31397c065fa98a4d1c81d2b8bf44e477e92b6c2415289ac1b

See more details on using hashes here.

File details

Details for the file topssh-2024.9.27-py3-none-any.whl.

File metadata

  • Download URL: topssh-2024.9.27-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for topssh-2024.9.27-py3-none-any.whl
Algorithm Hash digest
SHA256 66c74235e35a62b055678a759d3ecefe09ef3463d1ca6fdf0d07d3a265e0456b
MD5 01a1d8fc52d6e76992754043602b7fde
BLAKE2b-256 87bfacd80118b4f0db2ae2b44aa2e66b3e0c4d9b58078e0fc5087881f03cc6af

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page