Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
SSH tunneling over tor

Trying to connect to MySQL db via TOR proxy.

import paramiko
import MySQLdb

conf = paramiko.SSHConfig()
conf.parse(open('C:\ProgramData\ssh\sshd_config'))
host = conf.lookup('sql-tor')
print (host)

proxy = paramiko.ProxyCommand(host['proxycommand'])

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(host["hostname"], username=host["user"], password='test', sock=proxy)

con = MySQLdb.connect(host='127.0.0.1', port=3306, user='user', password='password', connect_timeout=60)
cur = con.cursor()

client.close()

Getting this error:

Exception has occurred: FileNotFoundError
[WinError 2] The system cannot find the file specified
  File "test2.py", line 8, in <module>
    proxy = paramiko.ProxyCommand(host['proxycommand'])

sshd_config:

host *-tor
   CheckHostIP  no
   Compression  yes
   Protocol     2
   ProxyCommand connect -4 -S localhost:9050 $(tor-resolve %h localhost:9050) %p

Any ideas how I can create ssh tunnel over tor? Or any other variants to do this without tunneling?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!