I want a shell script to find out the Pin Code to enter to the secure servers.
Setup: Pin is generated any one of our Four servers( Ex: pinser1,pinser2,pinser3,pinser4). whenever user is trying to access a secure server, A pin code is generated on above mentioned servers and always users are grepping the pin code in server file using his employee number. A user always entered to the four servers and searching the pin code.
To overcome this issue, I want a shell script to search all servers and print the Pin code with the help of his employee code.
1) Once he run the script, it should ask his employee number ( Ex: GS66778)
2) After he submitted the Employee Number It should connect to all servers and print the generated pin code.
log path for four servers : /var/log/genpin.log
connecting to servers ssh pin@pinser1 ( All ssh keys are exported to all servers so no need of password authentication)
----Enter Employee ID---
----Establish a connection to Four servers---
----search the pin code string in mentioned log files--
Experts please help me.
Thanks in advance.