Skip to main content

sshcon ⚡

Python SSH connector for linux systems

Python SSH connector for linux systems based on super fast SSH2 protocol library -> ssh2-python.

Installation

pip install sshcon

How to use

Make sure you check readthedocs!

from sshcon.main import SshCon


hostname = "myserver"
ssh_user = "myuser"
ssh_key = "/home/user/.ssh/mykey"
ssh = SshConn(hostname, ssh_user, ssh_key)

# Run command and save output to the variable
ls = ssh.run(["ls", "-latr", path("/mnt"], capture_output=True, check=True).stdout

# Mount directory
ssh.mount(source="storage:/data", "/mnt", force=True, mkdir=True)

# Remove files
ssh.remove("/my/folder/*.tar", force=True)

# Read text
text = ssh.read_text("/folder/text.txt")

# Write text
ssh.write_text("Hey!", "/folder/text.txt")

# Check if file
if ssh.isfile("/my/file):
    print("It's a file!")

Metadata

Release files for sshcon 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sshcon 0.3.3
File Size Uploaded
sshcon-0.3.3.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sshcon 0.3.3
File Interpreter ABI Platform
sshcon-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / sshcon-0.3.3.tar.gz

Download URL sshcon-0.3.3.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
17e03c937589e7bcd97df5c7055b4a93447c9787fe0c16226b8594278eb7f66f
BLAKE2b-256 checksum
How to use checksums
d958e017585df964e52314d87b6bf41b31df233b8c0deea310096c1c030f8e15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release files / sshcon-0.3.3-py3-none-any.whl

Download URL sshcon-0.3.3-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96289abb603cc8a6db17dfcd2aaa0e4bf1d9a61ddc7bbf94eff39ecf4ab2db99
BLAKE2b-256 checksum
How to use checksums
aed2ba7e6755d3800031d2c685f42eff5cc5747c46327ba606980bceb60095e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page