`
houkai2009
  • 浏览: 220191 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
  • 浪迹随风: 文章是挺好的,不过太杂了。。。信息量也很大。。。很难消化。。。 ...
    EJB 介绍
  • javaersu: yds3300376yd 写道学习了,只是楼主写的有点杂,现在 ...
    EJB 介绍
  • yds3300376yd: 学习了,只是楼主写的有点杂,现在还看不太懂,刚学习EJB,我觉 ...
    EJB 介绍
  • javaersu: 不错,这里也有一篇类似的EJB文章教程http://www.y ...
    EJB 介绍
  • dingding5060: brother , 你贴代码想说明什么???
    enum

#!/usr/bin/expect

 
阅读更多
#!/usr/bin/expect#!/usr/bin/expect
分享到:
评论

相关推荐

    expect中为send语句上加变量的代码

    /usr/bin/expectset ssh_user “fivetrees”set password “123456”spawn ssh -i /root/.ssh/$ssh_user root@xiaopp.3f.comexpect_before “no)?” {send “yes\r” }sleep 1expect “Enter passphrase for key*”...

    Mac下使用SSH连接远程Linux服务器

    本文主要介绍三种方法,在Mac下使用SSH连接远程Linux服务器。 方法一:使用终端 1.打开终端,点击新建远程连接... ... ... ...1.打开iTerm2并输入命令:cd ~/.ssh/ .../usr/bin/expect -f set user 自己的远程服务器的用户名 set

    用expect 实现切换用户时自动输入密码.txt

    #/usr/bin/expect -f spawn su - // 在expect 中用"spawn"关键字来调用命令“su - ” expect ":" //在执行了su - 命令之后,提示输入密码的提示符。例如你在执行了su - 命令之后,终端里面会出现提示“口令:”,...

    linux命令expect实现ssh登陆.docx

    /usr/bin/expect -f set ip "localhost" set passwd "liuliancao" set timeout 10 spawn ssh liuliancao@$ip expect "(yes/no)?" { send "yes\r" exp_continue } expect "password:" { send "$passwd\r" ...

    shell实现批量登录服务器修改用户密码

    大多时候,作为Linux系统运维人员,需要编写shell脚本去批量处理一些反复的工作。虽然现在有ansible、saltstack等批量处理.../usr/bin/env bash while read line do ip=`echo $line | awk '{print $1}'` password=`ec

    expect命令在linux下实现批量ssh免密

    有时候我们需要批量发送ssh命令给服务器,但是有可能有些服务器是新加入的,还没有配置ssh免密,这个时候就会提示我们输入yes/no 或者password等,expect脚本命令就是用于在提示这些.../usr/bin/expect而不是普通的bash

    用expect实现的自动登录到多台服务器的shell脚本

    /usr/bin/expect -fset ipaddress [lindex $argv 0]set passwd [lindex $argv 1]set timeout 30spawn ssh root@$ipaddress#expect “yes/no”#send “yesr”expect “password:”send “$passwdr”expect “]*”send...

    linux自动化交互脚本expect详解

    一、介绍 expect脚本是Tcl脚本语言的拓展。用来实现自动的交互式任务,无需人为干预。... 二、安装 expect在linux系统中没有自带,需要我们自行安装,在Ubuntu系统下,安装命令如下 .../usr/bin/expect set

    shell脚本无密码登录 expect的使用方法详解

    shell脚本无密码登录 expect的使用方法详解 ... 从网上查到使用expect可以,简单研究了一下,效果不错。  因为我的操作系统没有安装expect,所以直接”yum -y .../usr/bin/expect #使用第一个参数 set server_ip [l

    vtune自动安装脚本分享

    /usr/bin/expect -f#!/usr/bin/env bashyum install -y expect wgetcd /rootwget ...

    vtune自动化安装脚本

    /usr/bin/expect -f#!/usr/bin/env bashyum install -y expect wgetcd /rootwget ...

    except自动登录的几段代码分享

    /usr/bin/expect -fset timeout 30set host “192.168.1.198”spawn ssh $hostexpect_before “no)?” {send “yes\r” }sleep 1expect “password:”send “123456\r”expect “*#”send “echo my name is ...

    批量修改ssh配置的expect脚本

    第一思路,用iptables把外网ssh的包DROP掉;第二思路,用tcpwrapper把sshd的allow写死;第三思路,修改sshd_config,只监听内网请求。 由于一些说不清楚的原因,iptables的.../usr/bin/expect -flog_file exp.logset ti

    expect实现批量修改linux密码脚本分享

    /usr/bin/expect if { $argc<2> <cmd> \n”  exit }   # 机器列表数据格式: IP 端口 旧密码 新密码 set hostfile [ open [lindex $argv 0] ] # 命令列表数据格式: 一条命令一行 set cmdfile [ open [linde

    Linux实现自动登录的实例讲解

    /usr/bin/expect set timeout 30 spawn ssh -l username 192.168.1.1 expect password: send ispass\r interact 1. [#!/usr/bin/expect] 这一行告诉操作系统脚本里的代码使用那一个shell来执行。这里的expect其实...

    shell脚本连接并重启远程服务器的方法

    /usr/bin/expect expect -c spawn ssh ali@192.168.1.1 expect { \*assword\ {set timeout 30; send \123456\r\;} \yes/no\ {send \yes\r\; exp_continue;} } send \cd /home/ali/demoProject \r\ #根据系统而定 ...

    expect实现单台、多台服务器批量scp传输文件

    今天公司同事要在一台服务器上对另外两台.../usr/bin/expect if {$argc < 2} {  send_user “usage: $argv0 src_file username ip dest_file password\n” exit } ##set key [lindex $argv 0] set src_file [linde

    nagios 分发文件实现代码

    Nagios是一款开源的免费网络监视工具.../usr/bin/expect -f #!/usr/bin/env bash for((i=101;i<=177;i++)) do #cmd=wget http://172.16.92.99/scripts/nagios_client_install.sh && chmod 777 nagios_client_install

Global site tag (gtag.js) - Google Analytics