I need to regularly make queries to a remote machine in my python program by running shell commands. This is fine using subprocess.run(["ssh", "MY_SERVER", ....]), however I have to access the server by doing multiple ProxyJumps which makes the initial connection establishment very slow.
Is it possible to create a persistent connection to the server first and then issue shell commands and capture stdout through that pipe?