【发布时间】:2015-01-16 13:19:26
【问题描述】:
#!/usr/bin/perl
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,Errmode=>'die');
$telnet->open('hostname.domainname');
print "opened ...\n";
$telnet->waitfor('/login: $/i');
$telnet->print('pjpandey');
print "enetered username ...\n";
$telnet->waitfor('/password: $/i');
$telnet->print('pjp2213');
*我收到这个错误
connecting to "hostname.domainname", port 23: Connection refused at ./login.pl line 6
我想从 linux VM 登录窗口机器并通过 perl 脚本在 cmd 中朗读命令(java -jar selenium.jar)。
你能用 telnet 或任何其他脚本语言以外的方式帮助我吗?
提前致谢!*
【问题讨论】:
-
首先,您可能不希望那里有您的用户名和密码。如果不出意外,它会向所有人显示您使用的密码类型。其次,您可能没有在 windows 机器上运行 telnet 服务器。如果存在这样的东西,您必须安装它并确保它正在运行。不过,我对此无能为力。祝你好运,无论如何。