conf = paramiko.SSHConfig()
conf.parse(open('/home/user/.ssh/config'))
host = conf.lookup('host')
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)
client.close()
Python ssh using Tor proxy