#!/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
ssh配置信任关系脚本
- No comments yet.
- No trackbacks yet.
Recent Comments