Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > SecureCRT on the Mac


Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-05-2017, 12:32 PM
rleon rleon is offline
Registered User
Join Date: Jan 2008
Posts: 116
run ssh command

I am trying to ssh in .. and run the uptime command .. in my loop.

I am missing something i cant run the uptime command or any other strings.

def main():
crt.Screen.Synchronous = False
with open('/crt_scripts/working/hosts') as hosts_:
for host in hosts_:
crt.Screen.WaitForString("working # ")
crt.Screen.Send("ssh -oStrictHostKeyChecking=no root@" + host + uptime + '\r')
crt.Screen.WaitForString("word: ")
crt.Screen.Send("mypass" + chr(13))

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 09:27 PM.