A simple auto reconnect ssh tunnel client
Project description
auto-ssh
Usage:
with AutoSSHTunnel(
ssh_server='ssh.example.com',
ssh_username='your_username',
ssh_password='your_password',
remote_host='remote.example.com',
remote_port=3306,
local_port=5000,
ssh_port=2222
) as tunnel:
info = tunnel.get_tunnel_info()
print(f"SSH tunnel established from local port {info['local_port']} to {info['remote_host']}:{info['remote_port']}")
print(f"Tunnel is active: {'Yes' if info['is_active'] else 'No'}")
Or:
tunnel = AutoSSHTunnel(
ssh_server='ssh.example.com',
ssh_username='your_username',
ssh_password='your_password',
remote_host='remote.example.com',
remote_port=3306,
local_port=5000,
ssh_port=2222
)
tunnel.start()
try:
info = tunnel.get_tunnel_info()
print(f"SSH tunnel established from local port {info['local_port']} to {info['remote_host']}:{info['remote_port']}")
print(f"Tunnel is active: {'Yes' if info['is_active'] else 'No'}")
finally:
tunnel.stop()
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
autossh-0.0.1.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for autossh-0.0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f3c3a4c4fb794b0d5c227eb2127b3fc6187072d8eabfc53ea223b985bad265e |
|
MD5 | 3251ef8c354ee9f63c119196418bc7e2 |
|
BLAKE2b-256 | b94be58f83313ddf4c64bf8d5f8ed6fb8aaa0e90a38bd4b0bbcd9ba02b521f87 |