Transfer file(scp) and run command from jumpserver to finalserver using python script on localhost
问题 A file needs to be uploaded to final-server and a command needs to be run using that file as input. Following will be the steps for whole action to be performed (but I am stuck at step 3): 1 - transfer file from localhost to jumpserver (using scp) 2 - ssh to jumpserver 3 - transfer file from jumpserver to finalserver (using scp) 4 - ssh to finalserver 5 - run the command on finalserver (with file as input) try: cmd_str = "scp " + file_path + " " + user + "@" + jumpbox + ":/tmp/" print "------