Shell Programming

Automatic telnet on shell programming

Sometimes you want to execute script on your another server automatically without rsh. What you usually do is telnet to that server and execute the script. But how to make it automatic ?

You can use the tricky method bellow

Asume your server target is 198.10.10.2 and you want to execute
/home/hnawri/alarm.sh

(sleep 1
echo username
sleep 1
echo password
sleep 1
echo “/home/hnawri/alarm.sh”
sleep 1
sleep 1
exit) | telnet 198.10.10.2

Advertisements

Discussion

One thought on “Automatic telnet on shell programming

  1. Thanks for this! I looked for such a solution for a really long time. Can you add a short explanation of why this works?

    Posted by pepper23blues | July 22, 2008 3:10:56, 3:10 pm

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: