自动输入用户名和密码用于telnet的shell


所属类别:shell

文章作者:未知

特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!


自动输入用户名和密码用于tenlnet的shell, 哈哈 用linux的朋友且经常用配置路由器的可有福了. #===========autotelnet.sh============== #!/bin/bash if (( $# != 1 )) then echo " usage: address " exit 1 fi ip= inp1=`cat param grep "$ip" awk '{ print }'` inp2=`cat param grep "$ip" awk '{ print }'` inp3=`cat param grep "$ip" awk '{ print }'` inputfile=in outputfile=out rm -fr $inputfile rm -fr $outputfile mknod $inputfile p touch $outputfile #file description 7 for out and 8 for in exec 7<>$outputfile exec 8<>$inputfile telnet $ip <&8 >&7 & sleep 1; echo $inp1 >> $inputfile sleep 1; echo $inp2 >> $inputfile sleep 1; echo $inp3 >> $inputfile tail -f $outputfile & while true do read str if [[ $str = "quit" $str = "exit" ]] then echo $str >> $inputfile ; exit else echo $str >> $inputfile fi done #================================== 参数文件, 输入在出现正常提示符之前需要输入的所有内容, 用空格分开, 以ip地址或者hostname开头 #=====param============ localhost root password #=====================关闭本页

相关信息

· 《学VC 编游戏》重点算法解疑脚踏实地

· 结构设计检查表

· 显示器挑选经验:看,提,试YatiO

· 分享,讨论Programming的习惯








....

60776 34082