1
2
3
4
5
6
7
8
9
10
11
|
#!/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
|
本文转自bard_zhang51CTO博客,原文链接:http://blog.51cto.com/timefiles/1884170 ,如需转载请自行联系原作者