ssh配置信任关系脚本


#!/bin/bash
#for 249 login others with no passwd
#by shao

for i in $@

do 

if [ ! -f /root/.ssh/id_dsa.pub ];then
    ssh-keygen -t dsa
fi

scp /root/.ssh/id_dsa.pub root@10.10.$i:/tmp/
echo "copied"
ssh -l root root@10.10.$i " [ -e /root/.ssh ] || mkdir /root/.ssh"
ssh -l root root@10.10.$i "cat /tmp/id_dsa.pub >> /root/.ssh/authorized_keys"
echo "attaphed"
echo "10.10.$i is done!"
ssh -l root root@10.10.$i "rm -f  /tmp/id_dsa.pub"
done
  1. No comments yet.
(will not be published)

  1. No trackbacks yet.