[TOC] ## 教程 ``` # ssh-keygen -t rsa -P '' # ssh-copy-id -i .ssh/id_rsa.pub root@192.168.0.111 # ssh-copy-id -i .ssh/id_rsa.pub root@192.168.0.229 ``` 创建脚本 deploy.sh ``` #!/bin/bash ceph_ips=('192.168.0.110' '192.168.0.229' '192.168.0.111') opip(){ for ceph_ip in ${ceph_ips[@]} do ssh root@${ceph_ip} $1 & done } opip "echo 'hello word'>>/root/1.log" ``` 执行 `sh deploy.sh`