https://github.com/adamdelman/paramiko_tunnel
Native Python SSH tunnel based on Paramiko.
https://github.com/adamdelman/paramiko_tunnel
forwarding paramiko ssh tunnel tunnel-client tunneling
Last synced: 5 months ago
JSON representation
Native Python SSH tunnel based on Paramiko.
- Host: GitHub
- URL: https://github.com/adamdelman/paramiko_tunnel
- Owner: adamdelman
- License: gpl-3.0
- Created: 2017-08-05T14:39:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T11:05:34.000Z (almost 9 years ago)
- Last Synced: 2025-12-10T05:38:11.536Z (6 months ago)
- Topics: forwarding, paramiko, ssh, tunnel, tunnel-client, tunneling
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# paramiko_tunnel
Native Python SSH tunnel based on Paramiko.
Inspired by code from: https://github.com/paramiko/paramiko/blob/master/demos/forward.py
Example usage
-------------
~~~
import paramiko
import paramiko_tunnel
import requests
client = paramiko.SSHClient()
client.set_missing_host_key_policy(
paramiko.AutoAddPolicy(),
)
client.connect(
hostname='192.168.0.1',
port=22,
username='user',
password='hunter2,
)
with paramiko_tunnel.tunnel.Tunnel(
paramiko_session=client,
remote_host='172.16.1.1',
remote_port=80,
) as tunnel:
response = requests.get(
url='http://{bind_addr}:{bind_port}'.format(
bind_addr=tunnel.bind_address,
bind_port=tunnel.bind_port,
)
).content
print(response)
~~~