#1
|
|||
|
|||
script to SSH to host
![]() Code:
def main(): crt.Screen.Synchronous = False with open('/Users/rleon16/hosts') as hosts_: for host in hosts_: crt.Screen.WaitForString("working # ") crt.Screen.Send("ssh -oStrictHostKeyChecking=no root@" + host + ps -ef | grep gofer + '\r') crt.Screen.WaitForString("word: ") crt.Screen.Send("mypass!" + chr(13)) main() I am trying to string a ssh command but getting an error. I just want it to run the command and loop through. Any ideas? |
Thread Tools | |
Display Modes | |
|
|