Basically I want to write some script like
#!/bin/bash
for idx in 1 2 3 4 5 6
do
ssh machine$idx tmux new-session -d -s "myTempSession$idx" python run.py
done
which can do the thing separately on each machine as:
ssh machine$idx
tmux new-session -d -s "myTempSession$idx"
python run.py
but after many trial and error, I still cannot make it work as expected.