<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[secureCRT的登录sudo脚本---转自：向荣]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 04 May 2009 03:37:59 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	secureCRT的登录sudo脚本来源：<br/>http://oracledba.spaces.live.com/blog/cns!57D0C396BA028F14!276.entry<br/>secureCRT的登录sudo脚本<br/>如果你和我一样每天要开很多secureCRT窗口并且需要sudo（或者其他的事情），并且sudo还设置了timeout，那么一定要阅读这篇文章<br/><br/>一开始没每开一个secureCRT窗口总是要重复下面的事情：<br/>sudo su - oracle<br/>Password:<br/>在等待sudo su 的时候经常会timeout，后来到google，baidu上去找自动sudo 的脚本也没有找到，最后还是乖乖的翻secureCRT的help文档解决了这个问题。<br/><br/>在secureCRT安装目录下C:&#92;Program Files&#92;SecureCRT&#92;scripts<br/>打开example1.vbs<br/><br/><br/><div class="code">#$language = &quot;VBScript&quot;<br/>#$interface = &quot;1.0&quot;<br/><br/>Sub main<br/>&nbsp;&nbsp;&#039; turn on synchronous mode so we don&#039;t miss any data<br/>&nbsp;&nbsp;crt.Screen.Synchronous = True<br/><br/>&nbsp;&nbsp;&#039; Wait for a string that looks like &quot;login: &quot; or &quot;Login: &quot;<br/>&nbsp;&nbsp;crt.Screen.WaitForString &quot;ogin: &quot;<br/><br/>&nbsp;&nbsp;&#039; Send your username followed by a carriage return<br/>&nbsp;&nbsp;crt.Screen.Send &quot;username&quot; &amp; VbCr<br/><br/>&nbsp;&nbsp;&#039; Wait for a tring that looks like &quot;password: &quot; or &quot;Password: &quot;<br/>&nbsp;&nbsp;crt.Screen.WaitForString &quot;assword:&quot;<br/><br/>&nbsp;&nbsp;&#039; Send your password followed by a carriage return<br/>&nbsp;&nbsp;crt.Screen.Send &quot;password&quot; &amp; VbCr<br/><br/>&nbsp;&nbsp;&#039; turn off synchronous mode to restore normal input processing<br/>&nbsp;&nbsp;crt.Screen.Synchronous = False<br/>End Sub</div><br/><br/>修改username 为sudo su - oracle<br/>修改password 为你自己的password<br/>然后在session options里面设置logon script为该文件<br/><br/>最后记得把windows里面的权限设定为尽量小<br/><br/>有时为了登陆现场解决问题，需要绕多台主机才能抵达目的地，敲命令太麻烦，通过以下方式实现自动登陆，并且可以自动执行其它命令。<br/>Session Options - Connection - Logon Scripts - 选上Logon Script并选择自动登陆脚本<br/>Session Options - Connection - Telnet - Hostname - 设置第一台需登陆的主机ip或主机名<br/>自动登陆脚本示例：<br/><br/><div class="code">############################################################<br/>#$language = &quot;VBScript&quot;<br/>#$interface = &quot;1.0&quot;<br/>Sub main<br/>&nbsp;&nbsp; &#039; turn on synchronous mode so we don&#039;t miss any data<br/>&nbsp;&nbsp; crt.Screen.Synchronous = True&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp; crt.Screen.WaitForString &quot;ogin:&quot;<br/>&nbsp;&nbsp; crt.Screen.Send &quot;test&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.WaitForString &quot;assword:&quot;<br/>&nbsp;&nbsp; crt.Screen.Send &quot;testtest&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.WaitForString &quot;&gt;&gt;&quot;<br/>&nbsp;&nbsp; crt.Screen.Send &quot;telnet 212.75.30.146&quot; &amp; VbCr&nbsp;&nbsp;<br/>&nbsp;&nbsp; crt.Screen.WaitForString &quot;ogin:&quot;<br/>&nbsp;&nbsp; crt.Screen.Send &quot;test&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.WaitForString &quot;assword:&quot;<br/>&nbsp;&nbsp; crt.Screen.Send &quot;haha&quot; &amp; VbCr&nbsp;&nbsp;<br/>&nbsp;&nbsp; &#039;crt.Screen.Send &quot;export TERM=vt100&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.Send &quot;ksh&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.Send &quot;set -o vi&quot; &amp; VbCr<br/>&nbsp;&nbsp; crt.Screen.Send &quot;stty erase ^H&quot; &amp; VbCr<br/>&nbsp;&nbsp; &#039; turn off synchronous mode for normal input processing<br/>&nbsp;&nbsp; crt.Screen.Synchronous = False<br/>End Sub<br/>############################################################</div><br/><br/><br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] secureCRT的登录sudo脚本---转自：向荣]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>