Unable to SSH via Python subprocess
问题 I need to ssh into a machine via a bastion. Therefore the command is rather very long for this: ssh -i <pemfile location> -A -o 'proxycommand ssh -i <pemfile location> ec2-user@<bastion ip address> -W %h:%p' hadoop@<machine ip> This command is rather very long. So I tried to write a python script which takes ip addresses and pemfile location as inputs and does ssh. #!/usr/local/bin/python3 import argparse import subprocess import os import sys import errno parser = argparse.ArgumentParser