全部博文(1015)
分类: 系统运维
2012-04-01 15:28:37
建立登录会话并登录服务器
开始录制脚本
Script -> Start Recording Script
输入登录的命令
LANG=en_US.UTF-8
su - username
Password:
结束录制
Script -> Stop Recording Script
把脚本存成你喜欢的名字,例如Script.vbs
设置登录脚本
选中会话,右键Properties -> Connection -> Logon Scripts:
在“Logon scrip”前打钩,选中Script.vbs
Script.vbs脚本如下:
#$language = "VBScript"
#$interface = "1.0"
' This automatically generated script may need to be
' edited in order to work correctly.
Sub Main
crt.Screen.Send "LANG=en_US.UTF-8" & chr(13)
crt.Screen.WaitForString "]$ "
crt.Screen.Send "su - twotwo" & chr(13)
crt.Screen.WaitForString "Password: "
crt.Screen.Send "password" & chr(13)
End Sub