in reply to Re: how to connect to a remote server through telnet and fire couple of commands?
in thread how to connect to a remote server through telnet and fire couple of commands?
Hi,
Thanks for your reply. Through manually I can log on to a remote server through putty by using telnet. Then I executed some commands to get some work done. But I have executed following code, but getting the error as follows "timed-out waiting for command prompt at telnet.pl "line 10
use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $host="10.10.10.10"; $username="xyz"; $passwd="xyz1"; $t->open($host); $t->login($username, $passwd); @lines = $t->cmd("who"); print @lines;
The remote server in my case is only supported telnet, because if I select SSH option in putty, I can't log on into the server.
To perform those tasks automatically I need some Perl code, as I am working in a automation project.
Regards,
Sanjay
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to connect to a remote server through telnet and fire couple of commands?
by poj (Abbot) on Jun 17, 2016 at 10:11 UTC | |
|
Re^3: how to connect to a remote server through telnet and fire couple of commands?
by GotToBTru (Prior) on Jun 17, 2016 at 14:30 UTC |