ssh_host = 'my_ssh_host'
ssh_port = 22
user = 'login'
password = 's3cr3t'
transport = paramiko.Transport((ssh_host, ssh_port))
transport.connect(hostkey=None, username=user, password=password, pkey=None)
try:
    forward_tunnel(local_port, remote_host, remote_port, transport)
except KeyboardInterrupt:
    print('Port forwarding stopped.')
sys.exit(0)
Port forwarding with paramiko