SSH through Python with ~/.ssh/config file
<p>I'm trying to create a script that uses SSH in Python to log in to a remote machine. My script is then supposed to call a certain rest API from that machine, and then returns the response to the original client.</p>

<p>I can't use subprocesses so that's sadly out of the question. I tried using Paramiko and Fabric but ended up having hugely complicated code segments with a lot of mandatory fields. I have setup my public key in all the steps between me and the machine and can easily go through all the intermediate machines by just typing.</p>

<p>"SSH xxx" - in the terminal</p>

<p>So what I'm looking for is something that allows me to do this simple request without me having to re-specify everything that's already setup. Has anyone done anything similar?</p>