Greetings Monks, I am having trouble logging in with the telnet module. Here is my code:
$telnet->open($host); my $mode = $telnet->telnetmode; if ($mode == 0){$telnet->telnetmode(1)} my $fh = $telnet->input_log("tellog.txt"); $telnet->login($username, $passwd);
tellog.txt is revealing that the password is failing, but I have checked and double checked the username and password. I have both the uname and passwd declared in the form my $username='user'; I also tried double quotes, but no change. As you can see I tried forcing telnetmode to On per another post that I found. I can manually telnet to the host all day with the username and password, but for some reason this code is failing. By the way, I have also tried using waitfor to catch the login and password prompts then print to send them, but this doesn't work either. I'm connecting from SunOS 5.6 to SunOS 5.8. Thanks for any wisdom that can be sent my way. Update: Here are the contents of the dump_log
< 0x00000: ff fd 18 ff fd 1f ff fd 23 ff fd 27 ff fd 24 ÿý.ÿý.ÿ +ý#ÿý'ÿý$ > 0x00000: ff fc 18 ff fc 1f ff fc 23 ff fc 27 ff fc 24 ÿü.ÿü.ÿ +ü#ÿü'ÿü$ < 0x00000: ff fe 18 ff fe 1f ff fe 23 ff fe 27 ff fe 24 0d ÿþ.ÿþ.ÿ +þ#ÿþ'ÿþ$. < 0x00010: 0a 0d 0a 53 75 6e 4f 53 20 35 2e 36 0d 0a 0d 00 ...SunO +S 5.6.... < 0x00020: 0d 0a 0d 00 .... < 0x00000: ff fb 01 ff fb 03 ff fd 01 6c 6f 67 69 6e 3a 20 ÿû.ÿû.ÿ +ý.login: > 0x00000: ff fd 01 ff fd 03 ff fc 01 ÿý.ÿý.ÿ +ü. > 0x00000: some hex values here mylogin.. < 0x00000: ff fe 01 some hex values here ÿþ.mylogin.. < 0x00000: 50 61 73 73 77 6f 72 64 3a 20 Passwor +d: > 0x00000: some hex values here mypassword.. < 0x00000: 0d 0a .. < 0x00000: 4c 6f 67 69 6e 20 69 6e 63 6f 72 72 65 63 74 0d Login i +ncorrect. < 0x00010: 0a . < 0x00000: 6c 6f 67 69 6e 3a 20 login:
Other than seeing that the user name and password being sent are indeed correct, this isn't all that meaningful to me, maybe someone can help shed some light?

In reply to Net::telnet login by state-o-dis-array

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.