SecureCRT通过vbs脚本实现自动化登录linux服务器
1、配置登录主机名、用户和密码
2、配置登录后操作脚本目录
3、vbs操作脚本如下(crt也支持python)
#$language = "VBScript" #$interface = "1.0" crt.Screen.Synchronous = True Sub Main crt.Screen.Send "ssh clouder@196.166.36.60" & chr(13) if (crt.Screen.WaitForString("clo@196.166.36.60's password:", 5)<>False) Then crt.Screen.Send "1234567890" & chr(13) if (crt.Screen.WaitForString("]$", 5)<>False) Then 'crt.sleep 1000 crt.Screen.Send "cd /data/log/big-screen-zd" & chr(13) crt.Screen.Send "tail -f big-screen-zd.log" & chr(13) End If End If End Sub
代码说明:登录服务器后,再跳转196.166.36.60,并查看日志big-screen-zd.log