SecureCRT是一款支持SSH(SSH1和SSH2)的终端仿真程序,简单的说是Windows下登录UNIX或Linux服务器主机的软件。SecureCRT支持SSH,同时支持Telnet和rlogin协议。SecureCRT是一款用于连接运行包括Windows、UNIX和VMS的理想工具。通过使用内含的VCP命令行程序可以进行加密文件的传输。
SecureCRT脚本
js版本
XX.js内容如下:
# $language = "JScript"
# $interface = "1.0"
crt.screen.send("\n")
crt.screen.send("su - opr\n")
crt.screen.WaitForString("Password:",10)
crt.screen.send("#log\n")
crt.screen.send("stg\n")
crt.screen.send("slogssh -s test XX.XX.XX.XX\n")
crt.screen.send("cd /XX/XX.log\n")
crt.screen.send("tail -f XX.log\n")
VBScript版本
XX.vbs内容如下:
#$language = "VBScript"
#$interface = "1.0"
Sub main
' turn on synchronous mode so we don't miss any data
crt.Screen.Synchronous = True
' Wait for a string that looks like "login: " or "Login: "
crt.Screen.WaitForString "login: "
' Send your username followed by a carriage return
crt.Screen.Send "su - opr" & VbCr
' Wait for a tring that looks like "password: " or "Password: "
crt.Screen.WaitForString "assword:"
' Send your password followed by a carriage return
crt.Screen.Send "#log" & VbCr
' Send your password followed by a carriage return
crt.Screen.Send "stg" & VbCr
crt.Screen.Send "slogssh -s test XX.XX.XX.XX & VbCr
crt.Screen.Send "cd /XX/XX.log" & VbCr
' turn off synchronous mode to restore normal input processing
crt.Screen.Synchronous = False
End Sub
SecureCRT支持ActiveX script engines,包括VBScript和JScript (Microsoft’s version ofJavaScript)两种脚本。脚本可以用任何文本编辑器来开发。Script头部用来识别脚本语言和SecureCRT脚本接口的版本,脚本头部的每一行必须以#开头,头部包括$language行和$interface行。