Operating System - HP-UX
1834651 Members
2534 Online
110069 Solutions
New Discussion

Re: Need to check Telnet Login in Hudred servers !!

 
ezhilarasan_1
Occasional Advisor

Need to check Telnet Login in Hudred servers !!

Hi,

I need to check if my unix userid is working
in hundreds of Unix server. The userid and password are same, but only host will be different.

Manually doing telnet login to all server is
very time consuming. So I try to hard code a single script to login. Then I try to rcp .profile to the local unix host with name as hostname_profile. Then exit, try to do same
way for next server and so on.

Can you please write a small unix script for this for one server (sample). Similar way I will do for all my servers.

Thanks
R.Ezhil


2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: Need to check Telnet Login in Hudred servers !!

Make a list of hostnames.

Save password in a file called pword

while read -r hostname
do
telnet $hostname < pword
rc=$?
if [ $rc -eq 0 ]
then
echo "success"
else
echo "$hostname failed error $rc"
fi

done < list.of.hostnames

This script is not totally working and may need some tweaks. Consider it conceptutal.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stefan Farrelly
Honored Contributor

Re: Need to check Telnet Login in Hudred servers !!

Take a look here, you can write a script using expect or perl to do automatic logins using telnet;

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x70eae822e739d711abdc0090277a778c,00.html
Im from Palmerston North, New Zealand, but somehow ended up in London...