码迷,mamicode.com
首页 > 其他好文 > 详细

运维工作常用命令

时间:2014-10-15 04:41:50      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:运维 命令


  1. expect+ssh 修改主机密码

for ip in  `cat /tmp/myhosts`;do  
expect -c "spawn ssh -p33842 $ip; expect *assword* { send \"my old passwd\r\" };expect root@*  {send \"echo root:‘my new password‘ |/usr/sbin/chpasswd\r\" } ;expect root@*  {send \"ip addr \r\"} ;expect of " ;done


本文出自 “运维者说:从菜鸟到老鸟” 博客,请务必保留此出处http://liuqunying.blog.51cto.com/3984207/1564092

运维工作常用命令

标签:运维 命令

原文地址:http://liuqunying.blog.51cto.com/3984207/1564092

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!