Operating System - HP-UX
1834796 Members
2513 Online
110070 Solutions
New Discussion

Re: Automatic telnet login with disabling the System login messages

 
anil_garg5
Occasional Contributor

Automatic telnet login with disabling the System login messages

I am using the script which was earlier told by Muthukumar in this forum..
---------------------------------
(
echo "\n"
sleep 2
echo "\n"
sleep 2
echo "\n"
sleep 2
echo "exit\n"
) | telnet
----------------------------
This is good script to use. thanks for sharing Muthukumar.

How can I use stty -echo and stty echo commands within this code as I just want to show only the script output of the remote server and want to hide the other screen login messages. Can I do this here ? Please guide.

Thanks a lot....
Anil
3 REPLIES 3
Ivan Ferreira
Honored Contributor

Re: Automatic telnet login with disabling the System login messages

I think that is more secure and you can resolve your problem if you use ssh with public key authentication. You will not be transmiting username/password and you can run:

ssh hostname command

So you won't get any login messages.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Peter Godron
Honored Contributor

Re: Automatic telnet login with disabling the System login messages

Anil,
you may be better off getting all the output and then remove the bits you do not need.
Using your approach:
(
echo "\n"
sleep 2
echo "\n"
sleep 2
echo "echo \"****\"\n"
sleep2
echo "\n"
sleep 2
echo "echo \"***\"\n"
sleep 2
echo "exit\n"
) | telnet

Then delete everything before the first "***" and after the second "***".
anil_garg5
Occasional Contributor

Re: Automatic telnet login with disabling the System login messages

Thanks for your response. I will try it.