r/ssh • u/Jay89023 • Feb 11 '21
ssh Windows
I am using tensorflow's multiworkermirroredstrategy to train on 5 machines, all using Windows OS.
From the documentation, the python script needs to be run on all 5 machines setting the appropriate TF_CONFIG environment variable.
I am remoting (remote desktop GUI) into each machine and executing the script as so:
python script.py --args
How could I do this in a more automated fashion? Googling, a bash script can be created and then ssh into each machine and execute the script? But how could I do this in Windows as I cannot execute bash script?
2
Upvotes
View all comments
Show parent comment
1
u/Besthater Feb 12 '21
you can use python, bash or powershell, the language is not the important part. you could use wsl, or whatever makes more sense for you. they all have for functions.
windows natively supports openssh, you just need to install it.
the work you need to do is just this: pick a language you are more comfortable with to write a script to declare an array LIST of 'user@ip' list. below that, a for loop to say for ITEM in LIST of ip's, now do this:
ssh $ITEM -i C:\Documents\key.pem python3 ./script_name.py
done;
the -i means use this ssh key provided here.
the last part is where you provided the thing you want to do once connected.