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
Thanks for this! I looked for such a solution for a really long time. Can you add a short explanation of why this works?