#!/bin/bash ####################################################################################### # keygen ####################################################################################### #CREATED BY FAHAD SAEED on 24 june 2005 ######## This script creates the key pairs between the adjacent four ################ ######################### nodes acccording to the design ########################### ### The ip of this machine is obtained from the folder auto and the ips of the ######### ####### neighbouring machines are obtained from the folder admin generated by ######### ######### by the script "ipinrc" ########## ####################################################################################### echo ******************************************************************************** echo *************************** WARNING THIS IS A SECURITY HAZARD ***************** echo ********** Always RUN this script when u are logged in as ADMIN **************** ####################################################################################### ########### Generates key for this node and makes necessary modifications ############ ############################ to the .ssh of the admin ################################ ###### ips of the adjacent nodes can be obtained from /home/admin read ip1> /home/admin/.ssh/authorized_keys2" #### Key pairing for the second node scp /home/admin/.ssh/id_rsa.pub admin@$ip2:/home/admin/.ssh/authorized_keys3 ssh admin@$ip2 "cat /home/admin/.ssh/authorized_keys3 >> /home/admin/.ssh/authorized_keys2" ##### KEY pairing for the third node scp /home/admin/.ssh/id_rsa.pub admin@$ip3:/home/admin/.ssh/authorized_keys3 ssh admin@$ip3 "cat /home/admin/.ssh/authorized_keys3 >> /home/admin/.ssh/authorized_keys2" ##### KEY pairing for the fourth and the last adjacent node scp /home/admin/.ssh/id_rsa.pub admin@$ip4:/home/admin/.ssh/authorized_keys3 ssh admin@$ip4 "cat /home/admin/.ssh/authorized_keys3 >> /home/admin/.ssh/authorized_keys2" echo CONGRATS!! KEY pairing complete for this node