ssh免密脚本(亲测有效)
#!/bin/bash
for host in hadoop600 hadoop601 hadoop602
do
ssh $host
ssh-keygen -t rsa
for host1 in hadoop600 hadoop601 hadoop602
do
ssh-copy-id $host1
done
logout
done
#!/bin/bash
for host in hadoop01 hadoop02 hadoop03
do
ssh $host
for hosts in hadoop01 hadoop02 hadoop03
do
ssh $hosts
ssh-keygen -t rsa
ssh-copy-id $host
logout shell
done