Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko, socks
- # PySocks recommends using no arguments,
- # because it only supports the defaults anyway.
- sock = socks.socksocket()
- host, port = '127.0.0.1', 1234
- # Set up your proxy information for this socket
- sock.set_proxy(
- proxy_type=socks.SOCKS5,
- addr=host,
- port=port,
- username='spam',
- password='eggs',
- )
- # Connect the socket
- sock.connect((host, port))
- # Connect an SSHClient
- client = paramiko.SSHClient()
- client.connect(host, port, 'username', 'password', sock=sock)
- # Open SFTP session
- client.open_sftp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement