码迷,mamicode.com
首页 >  
搜索关键字:批量ssh信任 expect ssh-copy-id    ( 1515个结果
Python自动化运维之简易ssh自动登录
#!/usr/bin/envpython#-*-coding:utf-8-*-importpexpectimportsysssh=pexpect.spawn(‘sshroot@192.168.20.103‘)fout=file(‘sshlog.txt‘,‘w‘)ssh.logfile=foutssh.expect("root@192.168.20.103‘spassword:")ssh.sendline("yzg1314520")ssh.expect(‘#‘)ssh.sendline(‘ls/home‘)ss..
分类:编程语言   时间:2015-09-10 17:32:16    阅读次数:160
centOS6.5 heartbeatV3+pacemaker实现高可用集群
1.集群环境node1:192.168.220.111node2:192.168.220.1122.准备工作配置各节点SSH互信:#node1 ssh-keygen-trsa-f~/.ssh/id_rsa-P‘‘ ssh-copy-id-i.ssh/id_rsa.pubroot@192.168.220.112 #node2 ssh-keygen-trsa-f~/.ssh/id_rsa-P‘‘ ssh-copy-id-i.ssh/id_rsa.pubroot@192.168...
分类:其他好文   时间:2015-09-10 02:03:12    阅读次数:250
Linux expect 用法
expect是建立在tcl基础上的一个工具,它用来让一些需要交互的任务自动化地完成。因为expect是基于tcl的,所以需要你的系统中安装有tcl如何检查?[root@dev ~]# whereis tcltcl: /usr/lib/tcl8.4 /usr/share/tcl8.4如果看不到结果,请先安装tcl安装> 安装tcl解压tcl安装包后cd tcl8.4.11/unix/./config...
分类:系统相关   时间:2015-09-08 20:15:25    阅读次数:241
linux系统批量传输文件(SCP)
(1)首先,把要传输的主机ip保存到文件内viip10.161.4.x10.161.4.x10.161.4.x(2)编写脚本#!/usr/bin/kshusername=tomcat#这里是连接远程主机的用户名,本例中连接的远程主机用户名都一样#echo$usernamepassword=‘xxxxx‘#这里是密码#echo$passwordhomedir=">"ip_form=‘tomcat@..
分类:系统相关   时间:2015-09-07 14:27:30    阅读次数:249
expect实现ssh自动登录
expect实现ssh自动登录#!/usr/local/bin/expectset PASSWD [lindex $argv 1]set IP [lindex $argv 0]set CMD [lindex $argv 2]spawn ssh $IP $CMDexpect "(yes/no)...
分类:其他好文   时间:2015-09-04 14:05:01    阅读次数:151
expect 参数处理之一
expect 参数处理之一expect是很强悍的脚本,网上资源虽然很经典,但很少,我把自己的测试脚本贴之,仅作参考 #!/usr/bin/expect -f proc help {} { puts {usage: [-p ] [cmd] } } ...
分类:其他好文   时间:2015-09-04 14:01:49    阅读次数:125
shell 中嵌套expect 详解
之前我在写shell脚本中嵌套expect遇到了这样的问题,最后经过研究发现,在expect中的shell命令是需要转换才能生效的。否知错误百出,让人吐血不已。下面我讲解下我所遇到的问题。我要实现通过ping检测存活主机。如果存活将这个IP存入root/uphost.txt这个文件中。并且用expect免..
分类:系统相关   时间:2015-09-02 19:13:29    阅读次数:755
expect半自动磁盘扩容脚本
Expect是一个免费的编程工具语言,用来实现自动和交互式任务进行通信,而无需人的干预。 使用前需要先安装expect的rpm包,centos6.5 64位上的版本是expect-5.44.1.15-5.el6_4.x86_64 另外,可扩容是建立在/是逻辑...
分类:其他好文   时间:2015-09-01 15:23:49    阅读次数:207
expect用法
使用expect可以实现自动登录...
分类:其他好文   时间:2015-08-30 12:37:59    阅读次数:236
dp_AdapterPattern
适配器模式 Adapter Pattern 变压器模式Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.将一个类的接口变换...
分类:其他好文   时间:2015-08-29 17:02:26    阅读次数:169
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!