#!/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 [email protected]$ip $remote_cmd done
时间: 2024-10-09 07:59:28
#!/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 [email protected]$ip $remote_cmd done