码迷,mamicode.com
首页 > 系统相关 > 详细

shell 脚本远程执行脚本

时间:2016-12-20 11:59:14      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:linux   shell   

#!/bin/bash
#vim ip.txt server ip
ip_array=$(cat /tmp/ip.txt)
user="root"
passwd="password"
remote_cmd="/tmp/test.sh"
port=6122
for ip in ${ip_array[*]}
do
ssh -t -p $port $user@$ip $remote_cmd
done


本文出自 “汜水流年_” 博客,请务必保留此出处http://timefiles.blog.51cto.com/8475652/1884170

shell 脚本远程执行脚本

标签:linux   shell   

原文地址:http://timefiles.blog.51cto.com/8475652/1884170

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