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
Release history Release notifications | RSS feed
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.1.31.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for topssh-2024.1.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e2a50b3cc23c7abcab13027ec516d56f1a8a6eff5c19cb4c700021359ab4f94 |
|
MD5 | 4e8b31ad59d41c03878197ae5ddc7388 |
|
BLAKE2b-256 | a6d4f520c2b9b6879da1fa0ee706c37363b8a10b2264e4869289c4d0b323d4a1 |