Shell Script Commands to Automate Server or Host Telnet Login Session





Sunday, March 21, 2010 Leave a Comment

In linux,we usually come across repeated commands which we try to automate usinng shell scripts.One such major need arises,when we need to establish a telnet session to a system and perform some repeated commands in remote server or host.
So,In order to automate the telnet sessions,you just need to copy the following code in a file (say,node_login) and place it in the home directory.


Now add the command to your .bashrc file in your home directory.
alias node='/home/tectips/node_login'


Here,you must specify your path to your file earlier saved.So,when you type the keyword ‘node’,it will automatically login to your node with login and password you have provided in your scripts.
I have given three conditions,
i.If you type ‘node’ in your console,
command executed:   telnet 192.168.90.103
2.if you type ‘node 114′ (you have given the last substring of your ip)
command executed:   telent 192.168.90.114
3.If you type ‘node 114 1098′ (you have given last substring of your ip as well as your port)
command executed:  telnet 192.168.90.114 1098
You can change the subnet of the network as you wish by editing the scripts ,add commands after establishing telnet sessions,and enjoy automation.





Share this Post :
| More

0 comments »

Leave your response!

Add your comment below,or trackback from your own site.

Be nice. Keep it clean. Stay on topic. No spam.