hello guys i have three server and i mange it from SSH so i made this script to run my Register script "Register.py" so everyday i turn on Register mode so the problem how i can login to multiple SSH connection without close the other
import paramiko
import os
ZI1={"ip":"192.168.1.2","pass":"Administrator"}
ZI2={"ip":"192.168.1.3","pass":"AdminTeachers"}
ZI3={"ip":"192.168.1.4","pass":"AdminStudents"}
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
for F1 in ZI1:
ssh.connect(ZI1["ip"],username='root', password=ZI1["pass"])
ssh.exec_command('./register.py -time 6') #6 hour so the script still working for 6 hours
ssh.close()
for F2 in ZI2:
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
ssh.exec_command('./register.py -time 6')
ssh.close()
for F3 in ZI3:
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
ssh.exec_command('./register.py -time 6')
ssh.close()
so what i have to do to open 3 sessions without stopping script !!