sealiceivj 发表于 2020-02-11 14:25

请教 Perl use Net::Telnet问题(SUSE Linux)

本帖最后由 sealiceivj 于 2020-02-12 13:08 编辑

我用如下代码telnet到solaris, redhat,ubuntu Linux都没有问题, 但是却无法访问SUSE Linux(执行到*->login的时候报错),且报错如下, 怎么破啊?

直接用telnet 命令就可以登录..............

我是win10 访问 linux
win10 perl版本
This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)



错误信息如下:-
< 0x00000: 4c 61 73 7420 6c 6f 6769 6e 3a 204d 6f 6e 20Last login: Mon
< 0x00010: 46 65 62 2031 30 20 3133 3a 31 383a 31 32 20Feb 10 13:18:12
< 0x00020: 66 72 6f 6d20 31 37 322e 31 39 2e31 30 30 2efrom 172.19.100.
< 0x00030: 32 30 32 0d0a 48 61 7665 20 61 206c 6f 74 20202..Have a lot
< 0x00040: 6f 66 20 6675 6e 2e 2e2e 0d 0a 7463 73 68 3aof fun.....tcsh:
< 0x00050: 20 75 73 696e 67 20 6475 6d 62 2074 65 72 6d   using dumb term
< 0x00060: 69 6e 61 6c20 73 65 7474 69 6e 6773 2e 0d 0ainal settings...


< 0x00000: 74 73 65 743a 20 75 6e6b 6e 6f 776e 20 74 65tset: unknown te
< 0x00010: 72 6d 69 6e61 6c 20 7479 70 65 206e 65 74 77rminal type netw
< 0x00020: 6f 72 6b 0d0a                                     ork..


< 0x00000: 54 65 72 6d69 6e 61 6c20 74 79 7065 3f 20   Terminal type?



部分代码
use Net::Telnet;
$telnet=Net::Telnet->new($ip);
$telnet->login($usename,$password);


sealiceivj 发表于 2020-02-12 13:08

有没有大神帮帮忙,谢谢.
页: [1]
查看完整版本: 请教 Perl use Net::Telnet问题(SUSE Linux)